gpt4 book ai didi

docker - 将docker-compose链接到本​​地​​docker守护程序

转载 作者:行者123 更新时间:2023-12-02 20:23:56 24 4
gpt4 key购买 nike

我将在Ubuntu“服务器”上运行docker-compose。
首先,我尝试了默认安装。未定义$DOCKER_HOST。然后我将其设置为unix:///var/run/docker.sock
我一直有:

$ docker-compose up
ERROR: Couldn't connect to Docker daemon at http+docker://localunixsocket - is it running?

If it's at a non-standard location, specify the URL with the DOCKER_HOST environment variable.

docker守护程序已启动,我的 docker-compose.yml在Mac安装上工作正常。

仅供引用:
$ uname -a
Linux my-test 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19 09:28:15 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"

$ netstat -tunlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 5025/sshd
tcp6 0 0 :::22 :::* LISTEN 5025/sshd

$ docker version
Client:
Version: 1.9.1
API version: 1.21
Go version: go1.4.2
Git commit: a34a1d5
Built: Fri Nov 20 13:12:04 UTC 2015
OS/Arch: linux/amd64

Server:
Version: 1.9.1
API version: 1.21
Go version: go1.4.2
Git commit: a34a1d5
Built: Fri Nov 20 13:12:04 UTC 2015
OS/Arch: linux/amd64

$ docker info
Containers: 0
Images: 4
Server Version: 1.9.1
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 4
Dirperm1 Supported: false
Execution Driver: native-0.2
Logging Driver: json-file
Kernel Version: 3.13.0-57-generic
Operating System: Ubuntu 14.04.3 LTS
CPUs: 1
Total Memory: 490 MiB
Name: my-test
ID: YUQU:EUTG:XDDJ:F4KZ:COM6:H2AZ:LMOK:W4SR:BTXH:QEGS:6BLV:NIPQ
WARNING: No swap limit support

$ docker-compose version
docker-compose version 1.5.2, build 7240ff3
docker-py version: 1.6.0
CPython version: 2.7.6
OpenSSL version: OpenSSL 1.0.1f 6 Jan 2014

$ ls /var/run/dock*
/var/run/docker.pid /var/run/docker.sock

/var/run/docker:
execdriver netns

$ echo $DOCKER_HOST
unix:///var/run/docker.sock

最佳答案

您可能需要为Docker设置其他环境变量。一种简单的方法是在运行docker-compose之前运行以下命令。

eval $(docker-machine env default)

关于docker - 将docker-compose链接到本​​地​​docker守护程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35205151/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com