重新启动虚拟机后,命令docker images显示错误:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
码头工人服务似乎不正常。我试着在UbuntuVM(v20.10(上启动docker服务,docker引擎的版本是20.10.5。我使用systemctl状态docker进行的故障排除显示:
docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sun 2021-06-06 03:32:23 UTC; 13min ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Process: 7228 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=2)
Main PID: 7228 (code=exited, status=2)
Jun 06 03:32:20 cdipp-srv systemd[1]: Failed to start Docker Application Container Engine.
Jun 06 03:32:23 cdipp-srv systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Jun 06 03:32:23 cdipp-srv systemd[1]: Stopped Docker Application Container Engine.
Jun 06 03:32:23 cdipp-srv systemd[1]: docker.service: Start request repeated too quickly.
Jun 06 03:32:23 cdipp-srv systemd[1]: docker.service: Failed with result 'exit-code'.
Jun 06 03:32:23 cdipp-srv systemd[1]: Failed to start Docker Application Container Engine.
journalctl-ex显示:
Jun 06 03:32:20 cdipp-srv dockerd[7228]: github.com/docker/docker/vendor/golang.org/x/net/http2.readFrameHeader(0xc00051d298, 0x9, 0x9, 0x5615697ad340, 0xc000bb3560, 0x0, 0xc0272e510000000>
Jun 06 03:32:20 cdipp-srv dockerd[7228]: /go/src/github.com/docker/docker/vendor/golang.org/x/net/http2/frame.go:237 +0x89
Jun 06 03:32:20 cdipp-srv dockerd[7228]: github.com/docker/docker/vendor/golang.org/x/net/http2.(*Framer).ReadFrame(0xc00051d260, 0xc000fcbb40, 0xc000fcbb40, 0x0, 0x0)
Jun 06 03:32:20 cdipp-srv dockerd[7228]: /go/src/github.com/docker/docker/vendor/golang.org/x/net/http2/frame.go:492 +0xa3
Jun 06 03:32:20 cdipp-srv dockerd[7228]: github.com/docker/docker/vendor/google.golang.org/grpc/internal/transport.(*http2Client).reader(0xc000167880)
Jun 06 03:32:20 cdipp-srv dockerd[7228]: /go/src/github.com/docker/docker/vendor/google.golang.org/grpc/internal/transport/http2_client.go:1265 +0x185
Jun 06 03:32:20 cdipp-srv dockerd[7228]: created by github.com/docker/docker/vendor/google.golang.org/grpc/internal/transport.newHTTP2Client
Jun 06 03:32:20 cdipp-srv dockerd[7228]: /go/src/github.com/docker/docker/vendor/google.golang.org/grpc/internal/transport/http2_client.go:300 +0xd25
Jun 06 03:32:20 cdipp-srv dockerd[7228]: goroutine 642 [select]:
Jun 06 03:32:20 cdipp-srv dockerd[7228]: github.com/docker/docker/libcontainerd/remote.(*client).processEventStream(0xc0001503f0, 0x561569815820, 0xc00004fe40, 0x5615685fc82d, 0x4)
Jun 06 03:32:20 cdipp-srv dockerd[7228]: /go/src/github.com/docker/docker/libcontainerd/remote/client.go:782 +0x314
Jun 06 03:32:20 cdipp-srv dockerd[7228]: created by github.com/docker/docker/libcontainerd/remote.NewClient
Jun 06 03:32:20 cdipp-srv dockerd[7228]: /go/src/github.com/docker/docker/libcontainerd/remote/client.go:70 +0x27f
Jun 06 03:32:20 cdipp-srv dockerd[7228]: goroutine 641 [chan receive]:
Jun 06 03:32:20 cdipp-srv dockerd[7228]: github.com/docker/docker/daemon.(*Daemon).execCommandGC(0xc00000c3c0)
Jun 06 03:32:20 cdipp-srv dockerd[7228]: /go/src/github.com/docker/docker/daemon/exec.go:309 +0x14b
Jun 06 03:32:20 cdipp-srv dockerd[7228]: created by github.com/docker/docker/daemon.NewDaemon
Jun 06 03:32:20 cdipp-srv dockerd[7228]: /go/src/github.com/docker/docker/daemon/daemon.go:1140 +0x2aa9
Jun 06 03:32:20 cdipp-srv dockerd[7228]: goroutine 897 [sleep]:
Jun 06 03:32:20 cdipp-srv dockerd[7228]: runtime.goparkunlock(...)
Jun 06 03:32:20 cdipp-srv dockerd[7228]: /usr/local/go/src/runtime/proc.go:310
Jun 06 03:32:20 cdipp-srv dockerd[7228]: time.Sleep(0x1dcd6500)
Jun 06 03:32:20 cdipp-srv dockerd[7228]: /usr/local/go/src/runtime/time.go:105 +0x15d
Jun 06 03:32:20 cdipp-srv dockerd[7228]: github.com/docker/docker/vendor/github.com/docker/swarmkit/node.(*Node).initManagerConnection(0xc0003c85a0, 0x561569815820, 0xc000930500, 0xc0008b6>
Jun 06 03:32:20 cdipp-srv dockerd[7228]: /go/src/github.com/docker/docker/vendor/github.com/docker/swarmkit/node/node.go:937 +0x352
Jun 06 03:32:20 cdipp-srv dockerd[7228]: created by github.com/docker/docker/vendor/github.com/docker/swarmkit/node.(*Node).runManager
Jun 06 03:32:20 cdipp-srv dockerd[7228]: /go/src/github.com/docker/docker/vendor/github.com/docker/swarmkit/node/node.go:1064 +0x49a
Jun 06 03:32:20 cdipp-srv systemd[1]: docker.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- An ExecStart= process belonging to unit docker.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 2.
Jun 06 03:32:20 cdipp-srv systemd[1]: docker.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
--
-- The unit docker.service has entered the 'failed' state with result 'exit-code'.
Jun 06 03:32:20 cdipp-srv systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: A start job for unit docker.service has failed
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
请提出任何解决问题的想法。是否需要其他诊断?
尝试更新您的系统,尤其是与Docker相关的软件包。然后启动Docker.service,看看它是否成功运行。
对我来说,安装另一个版本的Docker解决了这个问题;具有CCD_ 1并且切换回CCD_。对我来说,另一个问题是,由于存储问题,我重新定位了目录/var/lib/docker
,在重新安装后,我修改了/lib/systemd/system/docker.service
以指向我的自定义docker目录。