Write to /etc/hosts in docker container when running docker container -


i trying write file in /etc/hosts within docker container when perform run command, when shh container , check hosts file, nothing has been written.

what correct command this?

i running image following command:

docker run -it -p 3000:3000 <imagename> bash echo 192.168.56.101 mypath.dev >> /etc/hosts

use "add-host" parameter when running container:

docker run -it --add-host db-static:86.75.30.9 ubuntu cat /etc/hosts 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -