How to edit /etc/hosts file in running docker container

后端 未结 3 2090
青春惊慌失措
青春惊慌失措 2020-12-29 14:39

I am working on an application which requires some configuration to be stored in /etc/hosts file of a docker container. I have tried it with many options but did not find a

3条回答
  •  醉梦人生
    2020-12-29 15:28

    I had the same problem and overcome it with vi in ex mode.

    ex -sc '%s/foo/bar/g|x' /etc/hosts

提交回复
热议问题