docker开机自动启动

方法一:

1chkconfig docker on

方法二:

1.1是用systemctl:

1systemctl 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查看

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

留下评论