Dockerd hosts config

I’m trying to set up dockerd on AlmaLinux 8. I want to have the the socket connect at -H unix:///var/run/docker.sock and the API at -H tcp://0.0.0.0:2375. However when I do this and try to run the following I get this:

[a@portainer000 ~]$ docker -H /var/run/docker.sock info
Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.10.0-docker)
  compose: Docker Compose (Docker Inc., v2.16.0)
  scan: Docker Scan (Docker Inc., v0.23.0)

Server:
ERROR: Cannot connect to the Docker daemon at tcp://localhost:2375/var/run/docker.sock. Is the docker daemon running?
errors pretty printing info
[a@portainer000 ~]$

Why is it not working? The daemon IS running.

[a@portainer000 ~]$ sudo systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
   Active: active (running) since Thu 2023-03-09 20:54:15 CST; 7s ago
     Docs: https://docs.docker.com
 Main PID: 102709 (dockerd)
    Tasks: 41
   Memory: 80.1M
   CGroup: /system.slice/docker.service
           ├─102709 /usr/bin/dockerd -H=fd:// --containerd=/run/containerd/containerd.sock -H unix:///var/run/docker.sock -H tcp://0.0.0.0:2375
           ├─102865 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 9000 -container-ip 172.17.0.2 -container-port 9000
           ├─102873 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 9000 -container-ip 172.17.0.2 -container-port 9000
           ├─102885 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 8000 -container-ip 172.17.0.2 -container-port 8000
           └─102892 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 8000 -container-ip 172.17.0.2 -container-port 8000

Mar 09 20:54:16 portainer000.satellite5.us dockerd[103132]: time="2023-03-09T20:54:16-06:00" level=info msg="Firewalld: docker zone already exists, returning"
Mar 09 20:54:16 portainer000.satellite5.us dockerd[103180]: time="2023-03-09T20:54:16-06:00" level=info msg="Firewalld: docker zone already exists, returning"
Mar 09 20:54:18 portainer000.satellite5.us dockerd[103321]: time="2023-03-09T20:54:18-06:00" level=info msg="Firewalld: docker zone already exists, returning"
Mar 09 20:54:18 portainer000.satellite5.us dockerd[102709]: time="2023-03-09T20:54:18.525857040-06:00" level=info msg="ignoring event" container=89ef925064fa2e6ca2ce791c2d29ff0b34d82d>
Mar 09 20:54:18 portainer000.satellite5.us dockerd[102709]: time="2023-03-09T20:54:18.749556276-06:00" level=error msg="fatal task error" error="task: non-zero exit (1)" module=node/a>
Mar 09 20:54:18 portainer000.satellite5.us dockerd[102709]: time="2023-03-09T20:54:18.940135216-06:00" level=warning msg="Error (Unable to complete atomic operation, key modified) del>
Mar 09 20:54:18 portainer000.satellite5.us dockerd[102709]: time="2023-03-09T20:54:18.982797268-06:00" level=info msg="initialized VXLAN UDP port to 4789 "
Mar 09 20:54:18 portainer000.satellite5.us dockerd[102709]: time="2023-03-09T20:54:18.982837984-06:00" level=info msg="initialized VXLAN UDP port to 4789 "
Mar 09 20:54:19 portainer000.satellite5.us dockerd[103484]: time="2023-03-09T20:54:19-06:00" level=info msg="Firewalld: docker zone already exists, returning"
Mar 09 20:54:21 portainer000.satellite5.us dockerd[102709]: time="2023-03-09T20:54:21.278758512-06:00" level=warning msg="Error (Unable to complete atomic operation, key modified) del>
[a@portainer000 ~]$

Hi

You write “-H tcp://0.0.0.0:2375” and “-H unix:///var/run/docker.sock”

but you dont use it ?
“docker -H /var/run/docker.sock info”

The socket(s) to bind to in daemon mode specified using one or more
         tcp://host:port/path, unix:///path/to/socket .....

I actually just figured it out in the last hour.

Appreciate the reply!

1 Like