使用systemctl命令(适用于使用systemd的系统):
systemctl is-active docker
active
表示正在运行inactive
表示未运行使用service命令:
service docker status
使用ps命令检查进程:
ps aux | grep dockerd
尝试运行Docker命令:
docker info
检查服务状态:
使用PowerShell命令:
Get-Service -Name "Docker Desktop Service"
查看系统托盘图标:
如果发现Docker未运行:
Linux:
sudo systemctl start docker # 使用systemd的系统
# 或
sudo service docker start # 使用init的系统
Windows/macOS: - 通过开始菜单/应用程序启动"Docker Desktop"
Linux:
sudo systemctl enable docker
Windows/macOS: - 在Docker Desktop设置中勾选"Start Docker Desktop when you log in"选项