Opening TCP Socket to Docker Not Working With Known Configuration Methods

52 views Asked by At

Attempting to open the TCP socket to my docker daemon so I can use an integration with Home Assistant to interface with Docker and control containers remotely.

I first attempted this method which modifies the daemon.json file to add the TCP socket as a host. That didn't work and so I tried to add host arguments to an override.conf file in my docker.service.d directory as seen here to a similar result.

In the second case, my journal logs read dockerd[283854]: "dockerd" accepts no argument(s).

(I would post the errors for the first method, but this is a live environment so downtime has to be during specific timeframes)

It would seem that in both situations, I cannot get dockerd to accept any host arguments to launch with the TCP socket open. I can only get docker to launch when I don't have these arguments in place. For example, here is my working daemon.json file:

{
    "log-driver": "journald",
    "storage-driver": "overlay2"
}

As a recap: This doesn't work (/etc/docker/daemon.json)

{
    "log-driver": "journald",
    "storage-driver": "overlay2"
    "hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]
}

But this does, without TCP access.

(/etc/systemd/system/docker.service.d/override.conf)

[Service]
ExecStart=
ExecStart=/usr/bin/dockerd daemon

I'll do my best to provide more information as requested. But I may need some assistance deriving it upon request.

Thanks for any tips or ideas.

(I would like to mention that I would prefer to open this socket as securely as possible. The host is on a DMZ, so if any other hosts on the VLAN are compromized, this one would also be.)

0

There are 0 answers