启用 Docker 远程 API - raspberry pi/raspbian [英] Enable Docker Remote API - raspberry pi / raspbian
问题描述
我的出发点是:
所以我编辑 /etc/init/docker.conf
并将 DOCKER_OPTS 变量的 2 次更新为:
so I edit /etc/init/docker.conf
and update 2 occurrences of the DOCKER_OPTS variable to:
DOCKER_OPTS='-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock'
然后,一个列出 docker 镜像的简单测试失败了:
Then, a simple test to list docker images fails:
$ service docker restart
$ curl -X GET http://10.143.0.218:4243/images/json
curl: (7) Failed to connect to 10.143.0.218 port 4243: Connection refused
Docker 版本是:
Docker version is:
$ sudo docker version
Client:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 19:06:36 2016
OS/Arch: linux/arm
Server:
Version: 1.12.3
API version: 1.24
Go version: go1.6.3
Git commit: 6b644ec
Built: Wed Oct 26 19:06:36 2016
OS/Arch: linux/arm
推荐答案
没有测试过这个,但是如果它是 Jessie,那么它默认使用 systemd 作为初始化系统 iirc,这对守护进程 (dockerd
) 已配置并启动.
Not tested this, but if it's Jessie, then it uses systemd by default as the init system iirc, and this has implications for how the daemon (dockerd
) is configured and started.
所以您正在编辑 /etc/init/docker.conf
文件,但我认为它没有被读取/使用.
So you're editing the /etc/init/docker.conf
file but I don't think that's being read / used.
阅读这篇关于Docker中每个init系统不同启动程序的文章, 和 这适用于特定的 systemd 配置.
这篇关于启用 Docker 远程 API - raspberry pi/raspbian的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!