linux安装完docker之后,执行systemctl start docker启动docker报Unknown operation ‘start docker‘错误

在CentOS 7.3上安装Docker 19.03.13后,使用`systemctl start docker`启动Docker遇到错误'Unknown operation 'start docker''。解决方法是使用`systemctl start docker.service`。同样,停止Docker时,使用`service docker stop`而非`systemctl stop docker`。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

我的linux操作系统是CentOS 7.3 64位,安装完docker之后,执行systemctl start docker启动docker报Unknown operation 'start docker'错误

于是我用systemctl start docker.service命令就能正常启动docker。

我用systemctl stop docker也是同样报Unknown operation"stop docker",后面改用service docker stop就能正常关闭docker了.

可能和linux操作系统版本有关,版本不一样,启停docker的命令也不一样。

[root@VM_0_5_centos ~]# docker -v
Docker version 19.03.13, build 4484c46d9d
[root@VM_0_5_centos ~]# systemctl start docker
Unknown operation 'start docker'.

[root@VM_0_5_centos ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: https://docs.docker.com
[root@VM_0_5_centos ~]# systemctl start docker.service
[root@VM_0_5_centos ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: active (running) since Tue 2020-11-17 21:11:33 CST; 5s ago
     Docs: https://docs.docker.com
 Main PID: 28955 (dockerd)
    Tasks: 8
   Memory: 133.8M
   CGroup: /system.slice/docker.service
           └─28955 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock

Nov 17 21:11:32 VM_0_5_centos dockerd[28955]: time="2020-11-17T21:11:32.754926664+08:00" level=info msg="ccResolverWrapper: sending updat...ule=grpc
Nov 17 21:11:32 VM_0_5_centos dockerd[28955]: time="2020-11-17T21:11:32.754937675+08:00" level=info msg="ClientConn switching balancer to...ule=grpc
Nov 17 21:11:32 VM_0_5_centos dockerd[28955]: time="2020-11-17T21:11:32.834383336+08:00" level=info msg="Loading containers: start."
Nov 17 21:11:33 VM_0_5_centos dockerd[28955]: time="2020-11-17T21:11:33.120521974+08:00" level=info msg="Default bridge (docker0) is assi...address"
Nov 17 21:11:33 VM_0_5_centos dockerd[28955]: time="2020-11-17T21:11:33.192775030+08:00" level=info msg="Loading containers: done."
Nov 17 21:11:33 VM_0_5_centos dockerd[28955]: time="2020-11-17T21:11:33.343032145+08:00" level=warning msg="Not using native diff for ove...overlay2
Nov 17 21:11:33 VM_0_5_centos dockerd[28955]: time="2020-11-17T21:11:33.343328022+08:00" level=info msg="Docker daemon" commit=4484c46d9d...19.03.13
Nov 17 21:11:33 VM_0_5_centos dockerd[28955]: time="2020-11-17T21:11:33.343439652+08:00" level=info msg="Daemon has completed initialization"
Nov 17 21:11:33 VM_0_5_centos dockerd[28955]: time="2020-11-17T21:11:33.396800309+08:00" level=info msg="API listen on /var/run/docker.sock"
Nov 17 21:11:33 VM_0_5_centos systemd[1]: Started Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.
[root@VM_0_5_centos ~]#

[root@VM_0_5_centos ~]# systemctl stop docker
Unknown operation 'stop docker'.

[root@VM_0_5_centos ~]#service docker stop
Redirecting to /bin/systemctl stop docker.service
[root@VM_0_5_centos ~]# systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: https://docs.docker.com

Nov 17 21:21:36 VM_0_5_centos dockerd[30557]: time="2020-11-17T21:21:36.366846546+08:00" level=info msg="Loading containers: done."
Nov 17 21:21:36 VM_0_5_centos dockerd[30557]: time="2020-11-17T21:21:36.374973388+08:00" level=warning msg="Not using native diff for ove...overlay2
Nov 17 21:21:36 VM_0_5_centos dockerd[30557]: time="2020-11-17T21:21:36.375178794+08:00" level=info msg="Docker daemon" commit=4484c46d9d...19.03.13
Nov 17 21:21:36 VM_0_5_centos dockerd[30557]: time="2020-11-17T21:21:36.375226894+08:00" level=info msg="Daemon has completed initialization"
Nov 17 21:21:36 VM_0_5_centos dockerd[30557]: time="2020-11-17T21:21:36.395310249+08:00" level=info msg="API listen on /var/run/docker.sock"
Nov 17 21:21:36 VM_0_5_centos systemd[1]: Started Docker Application Container Engine.
Nov 17 21:23:41 VM_0_5_centos systemd[1]: Stopping Docker Application Container Engine...
Nov 17 21:23:41 VM_0_5_centos dockerd[30557]: time="2020-11-17T21:23:41.628260672+08:00" level=info msg="Processing signal 'terminated'"
Nov 17 21:23:41 VM_0_5_centos dockerd[30557]: time="2020-11-17T21:23:41.628888302+08:00" level=info msg="Daemon shutdown complete"
Nov 17 21:23:41 VM_0_5_centos systemd[1]: Stopped Docker Application Container Engine.
Hint: Some lines were ellipsized, use -l to show in full.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值