docker: add clientOnly / docker-client
Currently the docker client is only available on non-linux platforms as `docker`, this makes the client available on linux and other platforms as `docker-client`. (cherry picked from commit 7233acd515546107e5902a8fef6832f4f319390c)
This commit is contained in:
parent
bb8a5e5484
commit
32c5e04919
|
@ -17,6 +17,7 @@ rec {
|
||||||
, btrfs-progs, iptables, e2fsprogs, xz, util-linux, xfsprogs, git
|
, btrfs-progs, iptables, e2fsprogs, xz, util-linux, xfsprogs, git
|
||||||
, procps, libseccomp
|
, procps, libseccomp
|
||||||
, nixosTests
|
, nixosTests
|
||||||
|
, clientOnly ? !stdenv.isLinux
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
docker-runc = runc.overrideAttrs (oldAttrs: {
|
docker-runc = runc.overrideAttrs (oldAttrs: {
|
||||||
|
@ -116,7 +117,7 @@ rec {
|
||||||
++ optional (libseccomp != null) "seccomp";
|
++ optional (libseccomp != null) "seccomp";
|
||||||
});
|
});
|
||||||
in
|
in
|
||||||
buildGoPackage ((optionalAttrs (stdenv.isLinux) {
|
buildGoPackage ((optionalAttrs (!clientOnly) {
|
||||||
|
|
||||||
inherit docker-runc docker-containerd docker-proxy docker-tini moby;
|
inherit docker-runc docker-containerd docker-proxy docker-tini moby;
|
||||||
|
|
||||||
|
@ -137,7 +138,7 @@ rec {
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
makeWrapper pkg-config go-md2man go libtool installShellFiles
|
makeWrapper pkg-config go-md2man go libtool installShellFiles
|
||||||
];
|
];
|
||||||
buildInputs = optionals (stdenv.isLinux) [
|
buildInputs = optionals (!clientOnly) [
|
||||||
sqlite lvm2 btrfs-progs systemd libseccomp
|
sqlite lvm2 btrfs-progs systemd libseccomp
|
||||||
] ++ optionals (buildxSupport) [ docker-buildx ];
|
] ++ optionals (buildxSupport) [ docker-buildx ];
|
||||||
|
|
||||||
|
@ -177,7 +178,7 @@ rec {
|
||||||
|
|
||||||
makeWrapper $out/libexec/docker/docker $out/bin/docker \
|
makeWrapper $out/libexec/docker/docker $out/bin/docker \
|
||||||
--prefix PATH : "$out/libexec/docker:$extraPath"
|
--prefix PATH : "$out/libexec/docker:$extraPath"
|
||||||
'' + optionalString (stdenv.isLinux) ''
|
'' + optionalString (!clientOnly) ''
|
||||||
# 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
|
||||||
|
|
||||||
|
@ -204,7 +205,7 @@ rec {
|
||||||
installManPage man/*/*.[1-9]
|
installManPage man/*/*.[1-9]
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru.tests = { inherit (nixosTests) docker; };
|
passthru.tests = lib.optionals (!clientOnly) { inherit (nixosTests) docker; };
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://www.docker.com/";
|
homepage = "https://www.docker.com/";
|
||||||
|
|
|
@ -23020,6 +23020,7 @@ in
|
||||||
|
|
||||||
docker = docker_20_10;
|
docker = docker_20_10;
|
||||||
docker-edge = docker_20_10;
|
docker-edge = docker_20_10;
|
||||||
|
docker-client = docker.override { clientOnly = true; };
|
||||||
|
|
||||||
docker-proxy = callPackage ../applications/virtualization/docker/proxy.nix { };
|
docker-proxy = callPackage ../applications/virtualization/docker/proxy.nix { };
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue