docker开机自动启动
方法一:
chkconfig docker on
方法二:
1.1是用systemctl:
systemctl enable docker
1.2将Docker的docker.service服务移动到系统服务中
# cp /usr/lib/systemd/system/docker.service /etc/systemd/system/ # systemctl daemon-reload # systemctl restart docker
1.3查看
ll /etc/systemd/system/multi-user.target.wants/docker.service
lrwxrwxrwx 1 root root 38 Mar 26 14:45 /etc/systemd/system/multi-user.target.wants/docker.service -> /usr/lib/systemd/system/docker.service