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

android - net_scheduler holding wakelock -

sql - MySQL : Getting Entries from a many-to-many table -

java - Retrieving data from database using jsp (Hibernate + Spring + Maven) -