简体   繁体   中英

How to restart play-with-docker docker daemon?

I am facing problem to restart the docker daemon inside the play-with-docker site. I edited the /etc/docker/daemon.json to add one private hosted registry, after editing I need to restart the docker daemon in order to make the changes. I don't find any service script to restart the docker daemon. What is the best way to restart docker daemon inside the play-with-docker site.

How to restart docker daemon after editing /etc/docker/daemon.json file ?

Solution

Find the PID of docker daemon

$ ps aux
PID   USER     TIME  COMMAND
    1 root      0:00 /bin/sh -c cat /etc/hosts >/etc/hosts.bak &&     sed 's/^:
   11 root      0:05 dockerd
   12 root      0:01 script -q -c /bin/bash -l /dev/null
   13 root      0:00 /bin/bash -l
   27 root      0:00 /usr/sbin/sshd -o PermitRootLogin=yes -o PrintMotd=no
   40 root      0:01 containerd --config /var/run/docker/containerd/containerd.
 6377 root      0:00 ps aux

The send HUP signal to the dockerd process.

$kill -HUP 11

此行将终止原始dockerd服务并在后台重新启动:

kill -9 `pgrep dockerd`; dockerd > /docker.log 2>&1 &

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM