怎么查看自己的docker守护进程有没有启动
时间: 2024-06-08 21:06:18 浏览: 163
你可以使用以下命令来检查 Docker 守护进程是否正在运行:
```
sudo systemctl status docker
```
如果 Docker 守护进程正在运行,你应该会看到类似下面的输出:
```
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2021-07-15 16:37:06 UTC; 3 weeks 0 days ago
Docs: https://docs.docker.com
Main PID: 1398 (dockerd)
Tasks: 24
Memory: 66.2M
CPU: 3.687s
CGroup: /system.slice/docker.service
├─1398 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
└─1418 containerd --config /var/run/containerd/containerd.toml --log-level info
```
如果 Docker 守护进程没有运行,你应该会看到类似下面的输出:
```
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: inactive (dead) since Thu 2021-07-15 16:35:12 UTC; 3 weeks 0 days ago
Docs: https://docs.docker.com
Process: 1087 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
Main PID: 1087 (code=exited, status=1/FAILURE)
```
如果 Docker 守护进程没有启动,你可以使用以下命令来启动它:
```
sudo systemctl start docker
```
阅读全文