logo

Docker sed: cannot rename /etc/sedl8ySxL: Device or resource busy

    • Josh
    • June 7th, 2017

    Unfortunately this didn’t help me, but the site header graphics gave me a good chuckle in the middle of me banging my head against a wall.

  1. Hi,

    cp -f ~/hosts.new /etc/hosts
    does fail: cp: can’t create ‘/etc/hosts’: File exists

    I’m however able to solve that issue thanks to the following command:
    echo “$(cat ~/hosts.new)” > /etc/hosts

    Best regards

    • Gabriel Fernandez
    • August 22nd, 2017

    Solved my problems. Thank you
    It’s worth noting that this must be done only on ENTRYPOINT or CMD, or yet manually running an exec command. It should not work in a RUN clause, since Docker will rewrite /etc/hosts in every layer it creates in your dockerfile.

  1. No trackbacks yet.

 
Bitnami