问题:Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
docker解决docker与守护进程间的通讯问题cannot connect :cannot connect to the Docker daemon at unix:///var/run/docker.sock
sudo chown *your-username* /var/run/docker.sock
dp@dp1:~$ service docker start Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
dp@dp1:~$ sudo docker info Client: Context: default Debug Mode: false Plugins: app: Docker App (Docker Inc., v0.9.1-beta3) buildx: Build with BuildKit (Docker Inc., v0.5.1-docker) Server: ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? errors pretty printing info
solution:
sudo snap install docker
dp@dp1:~$ sudo docker version Client: Docker Engine - Community Version: 20.10.3 API version: 1.40 Go version: go1.13.15 Git commit: 48d30b5 Built: Fri Jan 29 14:33:13 2021 OS/Arch: linux/amd64 Context: default Experimental: true Server: Engine: Version: 19.03.13 API version: 1.40 (minimum version 1.12) Go version: go1.13.15 Git commit: bd33bbf Built: Fri Feb 5 15:58:24 2021 OS/Arch: linux/amd64 Experimental: false containerd: Version: v1.3.7 GitCommit: 8fba4e9a7d01810a393d5d25a3621dc101981175 runc: Version: 1.0.0-rc10 GitCommit: docker-init: Version: 0.18.0 GitCommit: fec3683
dp@dp1:~$ sudo docker info Client: Context: default Debug Mode: false Plugins: app: Docker App (Docker Inc., v0.9.1-beta3) buildx: Build with BuildKit (Docker Inc., v0.5.1-docker) Server: Containers: 0 Running: 0 Paused: 0 Stopped: 0 Images: 0 Server Version: 19.03.13 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true Logging Driver: json-file Cgroup Driver: cgroupfs Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: runc Default Runtime: runc Init Binary: docker-init containerd version: 8fba4e9a7d01810a393d5d25a3621dc101981175 runc version: init version: fec3683 Security Options: apparmor seccomp Profile: default Kernel Version: 5.4.0-65-generic Operating System: Ubuntu Core 18 OSType: linux Architecture: x86_64 CPUs: 24 Total Memory: 125.5GiB Name: dp1 ID: ERC7:JCMW:P5CY:BI5L:R7Y4:6LIU:UDVG:WTGX:FJK5:H64O:TPGB:A5N4 Docker Root Dir: /var/snap/docker/common/var-lib-docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false WARNING: No swap limit support