4

I try to setup docker on my debian vm. After figuring out how to let docker read in the default/docker file I came across an issue where it is starting and actually on that port I configured it. But it isn't finished the startup process.

OS-Details:

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/default/docker:

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

service docker status

● 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://

As you can see it is running for 15min now and I don't know what the problem here is.

xetra11
  • 7,671
  • 14
  • 84
  • 159
  • Kill the service and run `sudo dockerd -H tcp://127.0.0.1:2375 -H fd://` in terminal and see if it works – Tarun Lalwani Aug 29 '17 at 12:56
  • `WARN[0000] [!] DON'T BIND ON ANY IP ADDRESS WITHOUT setting --tlsverify IF YOU DON'T KNOW WHAT YOU'RE DOING [!] no sockets found via socket activation: make sure the service was started by systemd ` – xetra11 Aug 29 '17 at 13:03
  • Use `sudo dockerd -H tcp://127.0.0.1:2375` instead – Tarun Lalwani Aug 29 '17 at 13:05
  • that finally does work! Thanks! I tried to get rid of `-H fd://` from the `docker.service` file but it looks like he is keeping it nevertheless – xetra11 Aug 29 '17 at 13:10
  • Which version of docker you have? Are you trying to upgrade from a previous version? – Tarun Lalwani Aug 29 '17 at 13:17
  • Version: 17.06.1-ce – xetra11 Aug 29 '17 at 13:19
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/153139/discussion-between-tarun-lalwani-and-xetra11). – Tarun Lalwani Aug 29 '17 at 13:19
  • 1
    In my case I had some remainders from a previous installation in /var/lib/docker. I stopped the service, uninstalled docker, removed that folder, installed docker, and it worked. – vlopez Jul 07 '18 at 09:40

1 Answers1

0

Docker has an URL-like syntax for its listening sockets (of dockerd) or connecting sockets (docker-cli). These are completely undocumented and often misleading. For example, fd:// does not listen on/connect to a file descriptor, instead it uses still sockets. I tried to collect a reference list, by analyzing the docker-cli source, in my this answer.

Also I've found similar problems with the default fd:// setting in the dockerd. Both my results, and here the question comments / chat logs show that changing it by a specified TCP port (ideally, tcp://127.0.0.1:2375) solves the problem.

peterh
  • 11,875
  • 18
  • 85
  • 108
  • Can't test it in the next time. If anybody is seeing this as a working solution just tell me I can mark it as answer then – xetra11 Nov 26 '20 at 09:10