我尝试在我的debian vm上设置docker。在弄清楚如何让docker在默认/ docker文件中读取之后,我遇到了一个问题,它启动并实际上在我配置它的端口上。但它还没有完成启动过程。
OS-详情:
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
的/ etc /默认/搬运工:
DOCKER_OPTS="-H tcp://127.0.0.1:2375"
docker.service :
[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target docker.socket firewalld.service
Wants=network-online.target
Requires=docker.socket
[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
EnvironmentFile=-/etc/default/docker
ExecStart=/usr/bin/docker -d $DOCKER_OPTS -H fd://
ExecReload=/bin/kill -s HUP $MAINPID
LimitNOFILE=1048576
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNPROC=infinity
LimitCORE=infinity
# Uncomment TasksMax if your systemd version supports it.
# Only systemd 226 and above support this version.
#TasksMax=infinity
TimeoutStartSec=0
# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes
# kill only the docker process, not all processes in the cgroup
KillMode=process
# restart the docker process if it exits prematurely
Restart=on-failure
StartLimitBurst=3
StartLimitInterval=60s
[Install]
WantedBy=multi-user.target
服务码头状态
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: activating (start) since Tue 2017-08-29 13:51:04 CEST; 15min ago
Docs: https://docs.docker.com
Main PID: 883 (docker)
Tasks: 3 (limit: 4915)
Memory: 4.2M
CPU: 10ms
CGroup: /system.slice/docker.service
└─883 /usr/bin/docker -d -H tcp://127.0.0.1:2375 -H fd://
正如您所看到的那样,现在 15分钟正在运行,我不知道这里的问题是什么。
答案 0 :(得分:0)
Docker的侦听套接字(dockerd)或连接套接字(docker-cli)具有类似于URL的语法。这些是完全没有证件的,并且经常会引起误解。例如,fd://
不侦听/连接文件描述符,而是使用静态套接字。我尝试通过分析this答案中的docker-cli来源来收集参考列表。
我在dockerd中的默认fd://
设置中也发现了类似的问题。我的结果和这里的问题注释/聊天记录都表明,通过指定的TCP端口(最好是tcp://127.0.0.1:2375
)对其进行更改即可解决问题。