![错误:无法连接到 http+docker://localhost 上的 Docker 守护程序 - 它正在运行吗?](https://linux22.com/image/737256/%E9%94%99%E8%AF%AF%EF%BC%9A%E6%97%A0%E6%B3%95%E8%BF%9E%E6%8E%A5%E5%88%B0%20http%2Bdocker%3A%2F%2Flocalhost%20%E4%B8%8A%E7%9A%84%20Docker%20%E5%AE%88%E6%8A%A4%E7%A8%8B%E5%BA%8F%20-%20%E5%AE%83%E6%AD%A3%E5%9C%A8%E8%BF%90%E8%A1%8C%E5%90%97%EF%BC%9F.png)
我的环境:
# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.6 (Maipo)
# uname -a
Linux X.Y.Z 3.10.0-957.12.1.el7.x86_64 #1 SMP Wed Mar 20 11:34:37 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
# rpm -qa | grep ^docker
docker-rhel-push-plugin-1.13.1-96.gitb2f74b2.el7.x86_64
docker-common-1.13.1-96.gitb2f74b2.el7.x86_64
docker-client-1.13.1-96.gitb2f74b2.el7.x86_64
docker-1.13.1-96.gitb2f74b2.el7.x86_64
#
我的问题:
# docker-compose up -d
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
#
# echo $DOCKER_HOST
#
然而
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
#
# docker info | head
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 1
Server Version: 1.13.1
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: true
Native Overlay Diff: true
#
我正在使用 Red Hat 附带的标准包(位置),但是尽管docker
客户端运行没有任何问题,但无论出于什么原因它都无法工作docker-compose
......
请指教。
可能与 SELinux 相关的问题:
# docker-compose ps
ERROR: Couldn't connect to Docker daemon at http+docker://localhost - is it running?
If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.
# getenforce
Enforcing
# setenforce 0
# docker-compose ps
Name Command State Ports
------------------------------
#