Docker package's systemd unit files don't work on Ubuntu

I used nix to install docker on Ubuntu 20.04, but the docker.service file is installed outside the systemd unit-path:
~/.nix-profile/etc/systemd/system/docker.service

After reading some posts I’m thinking that installing systemd unit files is not automatic on non-NixOS, So I tried to copy docker.service to /etc/systemd/system and start it manually. But:

  • The included docker.service is missing the matching docker.socket
    (at least from what I can see via nix edit nixpkgs.docker)
  • The ExecStart in the docker.service was not rewritten to point into /nix/store/…/dockerd/

After manually fetching the docker.socket, placing both files on the unit-path and patching the ExecStart manually, the dockerd started and works fine.

Is there some reason (maybe regarding NixOS of which I know nothing) to not include docker.socket and leave ExecStart unpatched?

Thanks

It’s a known issue but nobody has so far bothered to submit a patch to fix it.

I’d happily review and merge it.

Ah! I wish I saw that bug first. That’s what I see exactly. I’ll try and build a patch.
Thanks

1 Like