in my configuration.nix, but neither syntax variant has any noticable effect. The generated daemon.json file used by docker.service always looks like this:
My settings should be added to hosts, I think, but no dice. I found no mention of this, neither on the issues section nor in this forum, nor via Internet searches, so I thought it best to ask here what I might be doing wrong?
I am not exactly sure how to read your comment, @NobbZ . Are you saying that the sockets I configured should be available despite their absence in daemon.json? I see neither an open TCP port nor a UNIX socket file.
# /etc/systemd/system/docker.socket
[Unit]
Description=Docker Socket for the API
[Socket]
# If /var/run is not implemented as a symlink to /run, you may need to
# specify ListenStream=/var/run/docker.sock instead.
ListenStream=/run/docker.sock
SocketMode=0660
SocketUser=root
SocketGroup=docker
[Install]
WantedBy=sockets.target
# /nix/store/mf6zrpdsmv672253vhk63pdg2m10kp7p-system-units/docker.socket.d/overrides.conf
[Unit]
Description=Docker Socket for the API
[Socket]
ListenStream=tcp://127.0.0.1:1234
ListenStream=unix:///run/mysock
SocketGroup=docker
SocketMode=0660
SocketUser=root
[Install]
WantedBy=sockets.target
So that’s where my settings ended up. Like I mentioned, neither of my additions seems to have a visible effect, even after rebooting. I don’t expect to be required to enable some other service, or do I?
@NobbZ I don’t mean to be a bother, but I still cannot access Docker via TCP socket. If there is anything I can try (or need to change), please let me know.
A few minutes ago it worked on my machine for the first time. As mentioned in this issue, I was finally able to establish a connection using nc. That’s a great relief. I don’t understand why yet another reboot resolved the issue at last, but perhaps my manual restarting of services during the course of my tests caused problems for systemd.
Solution for the time being: Make sure to manually execute
systemctl restart docker.socket
when making changes to listenOptions. Whether or not nixos-rebuild switch should take care of this automatically is debatable. If all else fails, try to reboot the system to give systemd a clean slate.