Hi all,
I’m new in Docker, here is the docker version info:
Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.4.1
Git commit (client): a8a31ef
OS/Arch (client): linux/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.4.1
Git commit (server): a8a31ef
And the host is Ubuntu, version:
Linux mh-docker1 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
What I’m trying to do is to add a line to container’s hosts file, I can do this without any problem via command line:
sudo docker run -it --add-host centoshbase.mh.com:153.65.171.222 centos:mhtest
But I don’t want to do this every time in the command line, so I update /etc/default/docker, add
DOCKER_OPTS="–add-host centoshbase.mh.com:153.65.171.222"
After this change, I restart docker by “sudo service docker restart”.
Then I “ps aux|grep docker”, but there’s no docker process, it seems docker fails to start up.
So I wonder to know if this option add-host can be added to /etc/default/docker?