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
@ -105,6 +105,8 @@ rec {
|
|||||||
|
|
||||||
# systemd
|
# systemd
|
||||||
install -Dm644 ./contrib/init/systemd/docker.service $out/etc/systemd/system/docker.service
|
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 = []
|
DOCKER_BUILDTAGS = []
|
||||||
@ -178,6 +180,11 @@ rec {
|
|||||||
'' + optionalString (stdenv.isLinux) ''
|
'' + optionalString (stdenv.isLinux) ''
|
||||||
# symlink docker daemon to docker cli derivation
|
# symlink docker daemon to docker cli derivation
|
||||||
ln -s ${moby}/bin/dockerd $out/bin/dockerd
|
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)
|
# completion (cli)
|
||||||
installShellCompletion --bash ./contrib/completion/bash/docker
|
installShellCompletion --bash ./contrib/completion/bash/docker
|
||||||
|
Loading…
x
Reference in New Issue
Block a user