1

I start the docker daemon with -H fd:// in shell, and it error out. The OS is CentOS7.

# docker daemon -H fd://
FATA[0000] No sockets found

I can start with systemctl start docekr.

# cat /etc/systemd/system/docker.service.d/docker.conf 
[Service]
ExecStart=
ExecStart=/usr/bin/docker daemon -H fd://
# ps -ef|grep docker
/usr/bin/docker daemon -H fd://

In the admin guide, it says

On Systemd based systems, you can communicate with the daemon via Systemd socket activation, use docker daemon -H fd://. Using fd:// will work perfectly for most setups but you can also specify individual sockets: docker daemon -H fd://3. If the specified socket activated files aren’t found, then Docker will exit. You can find examples of using Systemd socket activation with Docker and Systemd in the Docker source tree.

So I can't use -H fd:// in shell?

firelyu
  • 2,102
  • 5
  • 25
  • 29

4 Answers4

4

Edit systemd configuration file for docker daemon and remove H fd:// and Update ExecStart variables as shown below:

# cd /etc/systemd/system/docker.service.d
[root@docker docker.service.d]# cat override.conf
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock

Reload daemon and start service

 systemctl daemon-reload
 systemctl start docker
 systemctl status docker |grep running

Active: active (running) since Sat 2018-06-30 14:52:49 CDT; 1min 56s ago Jun 30 14:52:48 docker dockerd[16917]: time="2018-06-30T14:52:48.685718828-05:00" level=info msg="Firewalld running: true" [root@docker docker.service.d]#

ArunMishra
  • 41
  • 3
2

To start docker daemon, fd:// means it's being started by Systemd, and the listening socket is created by Systemd and passed to docker daemon. So if you try to using it from terminal, it will fail because you don't create socket and pass it to docker daemon. For docker cli, you can use it the same way with tcp protocol if you have tcp socket listening.

I've answered a similar question at https://stackoverflow.com/a/43408869/1000254, you can refer to it for more details.

Community
  • 1
  • 1
shizhz
  • 11,715
  • 3
  • 39
  • 49
0

For anyone still struggle with this issue, this answer help me solve it: https://forums.docker.com/t/failed-to-load-listeners-no-sockets-found-via-socket-activation-make-sure-the-service-was-started-by-systemd/62505

Change fd:// to unix:// in docker.service file locate in etc/systemd/system

Igris Dankey
  • 383
  • 2
  • 6
0

For those who use daemon.json file you have to make sure the json is valid in my case the file didn't end with new line and that coursed the error

Elias Bundala
  • 144
  • 1
  • 5