安裝dockers後沒法使用?

報錯以下:
/usr/bin/docker-current: Cannot connect to the Docker daemon at tcp://localhost:2375. Is the docker daemon running?.
See '/usr/bin/docker-current run --help'.
 
解決辦法:linux

進入 /lib/systemd/system/docker.servicegit

原文件部份內容:docker

ExecStart=/fsr/bin/dockerd-current \
--add-runtime docker-runc=/usr/libexec/docker/docker-runc-current \
--default-runtime=docker-runc \
--exec-opt native.cgroupdriver=systemd \
--userland-proxy-path=/usr/libexec/docker/docker-proxy-current \
--init-path=/usr/libexec/docker/docker-init-current \
--seccomp-profile=/etc/docker/seccomp.json \
$OPTIONS \
$DOCKER_STORAGE_OPTIONS \
$DOCKER_NETWORK_OPTIONS \
$ADD_REGISTRY \
$BLOCK_REGISTRY \
$INSECURE_REGISTRY \
$REGISTRIESjson

這上述部分所有註釋,並從新寫成以下部份內容:centos

ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock -H tcp://0.0.0.0:7654
其餘參數不變,重啓dockertcp

systemctl daemon-reloadide

systemctl restart docker.serviceui

完成後,查看是否啓動正常,而且能夠看到版本信息unix

[root@localhost system]# docker version
Client:
Version: 1.13.1
API version: 1.26
Package version: docker-1.13.1-102.git7f2769b.el7.centos.x86_64
Go version: go1.10.3
Git commit: 7f2769b/1.13.1
Built: Mon Aug 5 15:09:42 2019
OS/Arch: linux/amd64rest

Server:Version: 1.13.1API version: 1.26 (minimum version 1.12)Package version: docker-1.13.1-102.git7f2769b.el7.centos.x86_64Go version: go1.10.3Git commit: 7f2769b/1.13.1Built: Mon Aug 5 15:09:42 2019OS/Arch: linux/amd64Experimental: false

相關文章
相關標籤/搜索