I'm new to docker, and want to restart docker daemon. I want to add the OPTS to start docker like:
docker --registry-mirror=http://<my-docker-mirror-host> -d
I want to know what is they difference? Does they start the same thing?
By the way, I just use above command in my boot2docker, it did't work at all.
if you use
service docker start
then it will start docker as service with docker's upstart configuration file, e.g./etc/default/docker
for ubuntu and/etc/sysconfig/docker
for centos.if you use
docker -d
it will run docker in daemon mode.if you want define your own
registry-mirror
for docker, you can do this:ubuntu
centos
mac
then your docker service with run with your own registry mirror.
To answer your questions (which are valid for debian/ubuntu, I don't have tinylinux handy to test which is used by boot2docker):
service docker start
will run a startup script in /etc/init.d/dockerdocker -d
is the manual version of the previous script, useful when you want to run docker in debug mode. I suspect the example you gave will not do the same thing, because there are more options specified in the service script./etc/default/docker
fileUpdate after OP's comments:
To add your new switch, you need to specifically edit the variable (which maybe exported)
DOCKER_OPTS
and add your option to the end of the existing options.My /etc/default/docker options are:
To add the registry-mirror I would edit the DOCKER_OPTS to look like this