docker开机自动启动

方法一:

1 chkconfig docker on

方法二:

1.1是用systemctl:

1 systemctl enable docker

1.2将Docker的docker.service服务移动到系统服务中

123 # cp /usr/lib/systemd/system/docker.service /etc/systemd/system/ # systemctl daemon-reload # systemctl restart docker

1.3查看

1 ll /etc/systemd/system/multi-user.target.wants/docker.service
1 lrwxrwxrwx 1 root root 38 Mar 26 14:45 /etc/systemd/system/multi-user.target.wants/docker.service -> /usr/lib/systemd/system/docker.service

留下评论