我的环境:
# 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
------------------------------
#