Docker服务的重启服务命令详解(systemctl restart docker)
作者:常家壮
Docker服务的重启服务命令
重启Docker服务
#重启docker服务: systemctl restart docker
非root用户使用
#重启docker服务: sudo systemctl restart docker
在使用systemctl start docker启动失败时,使用systemctl status docker.service
报告如下:
root@localhost ~]# systemctl status docker.service
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled;
vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2018-07-25 00:24:56
EDT; 2min 4s ago
Docs: http://docs.docker.com
Main PID: 2600 (code=exited, status=1/FAILURE)Jul 25 00:24:54 localhost.localdomain systemd[1]: Starting Docker...
Jul 25 00:24:54 localhost.localdomain dockerd-current[2600]: time...
Jul 25 00:24:54 localhost.localdomain dockerd-current[2600]: time...
Jul 25 00:24:55 localhost.localdomain dockerd-current[2600]: time...
Jul 25 00:24:56 localhost.localdomain dockerd-current[2600]: Erro...
Jul 25 00:24:56 localhost.localdomain systemd[1]: docker.service:...
Jul 25 00:24:56 localhost.localdomain systemd[1]: Failed to start...
Jul 25 00:24:56 localhost.localdomain systemd[1]: Unit docker.ser...
Jul 25 00:24:56 localhost.localdomain systemd[1]: docker.service ...
Hint: Some lines were ellipsized, use -l to show in full.
查资料得知:
这里是linux的内核中的SELinux不支持 overlay2 graph driver
解决方法有两个
要么启动一个新内核,要么就在docker里禁用selinux,–selinux-enabled=false
vi /etc/sysconfig/docker
然后systemctl start docker,问题解决!
总结
以上为个人经验,希望能给大家一个参考,也希望大家多多支持脚本之家。