docker: fix systemd unit files (#120019)
* docker: fix systemd unit files Add missing docker.socket file and patch ExecStart in docker.service so these units are useful on non-nixos systems using systemd. (issue #70407) * moved systemd units under: optionalString (stdenv.isLinux)
This commit is contained in:
parent
1f0fb586c3
commit
a54bc9b671
1 changed files with 7 additions and 0 deletions
|
@ -105,6 +105,8 @@ rec {
|
|||
|
||||
# systemd
|
||||
install -Dm644 ./contrib/init/systemd/docker.service $out/etc/systemd/system/docker.service
|
||||
substituteInPlace $out/etc/systemd/system/docker.service --replace /usr/bin/dockerd $out/bin/dockerd
|
||||
install -Dm644 ./contrib/init/systemd/docker.socket $out/etc/systemd/system/docker.socket
|
||||
'';
|
||||
|
||||
DOCKER_BUILDTAGS = []
|
||||
|
@ -178,6 +180,11 @@ rec {
|
|||
'' + optionalString (stdenv.isLinux) ''
|
||||
# symlink docker daemon to docker cli derivation
|
||||
ln -s ${moby}/bin/dockerd $out/bin/dockerd
|
||||
|
||||
# systemd
|
||||
mkdir -p $out/etc/systemd/system
|
||||
ln -s ${moby}/etc/systemd/system/docker.service $out/etc/systemd/system/docker.service
|
||||
ln -s ${moby}/etc/systemd/system/docker.socket $out/etc/systemd/system/docker.socket
|
||||
'' + ''
|
||||
# completion (cli)
|
||||
installShellCompletion --bash ./contrib/completion/bash/docker
|
||||
|
|
Loading…
Reference in a new issue