服务停泊点开始的区别是什么?和“docker -d” [英] What is the difference b/w "service docker start" and "docker -d"?
问题描述
docker --registry-mirror = http://< my-搬运工镜宿主> -d
我想知道他们有什么区别?他们开始一样吗?
顺便说一句,我只是在我的boot2docker中使用上面的命令,它根本没有工作。
如果您使用 service docker start
,那么它将启动docker作为docker的upstart配置文件的服务,例如对于ubuntu和 / etc / sysconfig / docker
为centos。
$ b
如果您使用 docker -d
,它将以守护进程运行docker。
如果要为docker定义自己的 registry-mirror
,可以这样做:
ubuntu
$ echoDOCKER_OPTS = \\ $ DOCKER_OPTS --registry-mirror = http://< my-docker-mirror -host> \| sudo tee -a / etc / default / docker
$ sudo service docker restart
centos
sudo sed -i的| other_args = | other_args = - registry-mirror = http://< my-docker -mirror主机> | g'/ etc / sysconfig / docker
sudo sed -is | OPTIONS ='| OPTIONS =' - registry-mirror = http://< my-docker-mirror-host> | g / etc / sysconfig / docker
sudo service docker restart
mac
boot2docker up
pre>
boot2docker sshecho $'EXTRA_ARGS = \--registry-mirror = http://< my-docker -mirror-host> \'| sudo tee -a / var / lib / boot2docker / profile&& sudo /etc/init.d/docker restart
然后您的Docker服务与您自己的注册表镜像一起运行。
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
$ echo "DOCKER_OPTS=\"\$DOCKER_OPTS --registry-mirror=http://<my-docker-mirror-host>\"" | sudo tee -a /etc/default/docker $ sudo service docker restart
centos
sudo sed -i 's|other_args=|other_args=--registry-mirror=http://<my-docker-mirror-host> |g' /etc/sysconfig/docker sudo sed -i "s|OPTIONS='|OPTIONS='--registry-mirror=http://<my-docker-mirror-host> |g" /etc/sysconfig/docker sudo service docker restart
mac
boot2docker up boot2docker ssh "echo $'EXTRA_ARGS=\"--registry-mirror=http://<my-docker-mirror-host>\"' | sudo tee -a /var/lib/boot2docker/profile && sudo /etc/init.d/docker restart"
then your docker service with run with your own registry mirror.
这篇关于服务停泊点开始的区别是什么?和“docker -d”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!