You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hello, i use docker exec 1ebea17823f3 echo test >> /etc/hosts to change the container /etc/hosts, but i find that the container hosts do not change. it change the vm /etc/hosts.
The text was updated successfully, but these errors were encountered:
(Added the parentheses to illustrate the problem) Basically, the echo test runs inside the container, but the output is returned to the host (vm) and added to /etc/hostsof the VM.
Try it this way, so that both the "echo" AND the >> /etc/hosts take place inside the container;
docker exec 1ebea17823f3 /bin/sh -c "echo test >> /etc/hosts"
I'm going to close this issue, because it's not a bug, but I hope the above explanation helps you further!
hello, i use
docker exec 1ebea17823f3 echo test >> /etc/hosts
to change the container /etc/hosts, but i find that the container hosts do not change. it change the vm /etc/hosts.The text was updated successfully, but these errors were encountered: