gpt4 book ai didi

docker - 启用 Docker 远程 API - raspberry pi/raspbian

转载 作者:行者123 更新时间:2023-12-02 18:08:01 26 4
gpt4 key购买 nike

我的出发点是:

所以我编辑 /etc/init/docker.conf 并将 DOCKER_OPTS 变量的 2 次出现更新为:

DOCKER_OPTS='-H tcp://0.0.0.0:4243 -H unix:///var/run/docker.sock'

然后,列出 docker 图像的简单测试失败:

$ 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 版本是:

$ 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

最佳答案

解决方法来自本页评论:http://www.virtuallyghetto.com/2014/07/quick-tip-how-to-enable-docker-remote-api.html

[08/18/2016 at 6:00 am] Oliver Weise says: Thanks, that put me in the right direction. However since Ubuntu 16.04 with its systemd docker daemon the /etc/default/docker is no longer effective. Instead you need to create a systemd dropin file.

I placed such a file under: /etc/systemd/system/docker.service.d/remote-api.conf

With the contents:

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H tcp://127.0.0.1:2376 -H unix:///var/run/docker.sock

(Yes, the double ExecStart is necessary)

After that run:

sudo systemctl daemon-reload // reloading daemon definitions
sudo systemctl restart docker

关于docker - 启用 Docker 远程 API - raspberry pi/raspbian,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40591356/

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