How can I make /etc/hosts writable by root in a Docker Container?

后端 未结 4 543
花落未央
花落未央 2021-01-31 18:43

I\'m new to using docker and am configuring a container.
I am unable to edit /etc/hosts (but need to for some software I\'m developing). Auto-edit (via sudo or root) of the

4条回答
  •  攒了一身酷
    2021-01-31 19:33

    /etc/hosts is now writable as of Docker 1.2.

    From Docker's blog:

    Note, however, that changes to these files are not saved during a docker build and so will not be preserved in the resulting image. The changes will only “stick” in a running container.

提交回复
热议问题