diff options
| author | zowoq <59103226+zowoq@users.noreply.github.com> | 2021-05-27 09:59:49 +1000 |
|---|---|---|
| committer | Robert Hensing <robert@roberthensing.nl> | 2021-06-02 09:14:21 +0200 |
| commit | 32c5e04919862b40b4048402a0f395750b2df906 (patch) | |
| tree | 8ec7b250509e75418de52f2922d0d3a9ecae255d | |
| parent | Merge pull request #125305 from NixOS/backport-125300-to-release-21.05 (diff) | |
| download | nixpkgs-32c5e04919862b40b4048402a0f395750b2df906.tar.gz | |
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)
| -rw-r--r-- | pkgs/applications/virtualization/docker/default.nix | 9 | ||||
| -rw-r--r-- | pkgs/top-level/all-packages.nix | 1 |
2 files changed, 6 insertions, 4 deletions
diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix index 954404e5268f..6b72653c3472 100644 --- a/pkgs/applications/virtualization/docker/default.nix +++ b/pkgs/applications/virtualization/docker/default.nix @@ -17,6 +17,7 @@ rec { , btrfs-progs, iptables, e2fsprogs, xz, util-linux, xfsprogs, git , procps, libseccomp , nixosTests + , clientOnly ? !stdenv.isLinux }: let docker-runc = runc.overrideAttrs (oldAttrs: { @@ -116,7 +117,7 @@ rec { ++ optional (libseccomp != null) "seccomp"; }); in - buildGoPackage ((optionalAttrs (stdenv.isLinux) { + buildGoPackage ((optionalAttrs (!clientOnly) { inherit docker-runc docker-containerd docker-proxy docker-tini moby; @@ -137,7 +138,7 @@ rec { nativeBuildInputs = [ makeWrapper pkg-config go-md2man go libtool installShellFiles ]; - buildInputs = optionals (stdenv.isLinux) [ + buildInputs = optionals (!clientOnly) [ sqlite lvm2 btrfs-progs systemd libseccomp ] ++ optionals (buildxSupport) [ docker-buildx ]; @@ -177,7 +178,7 @@ rec { makeWrapper $out/libexec/docker/docker $out/bin/docker \ --prefix PATH : "$out/libexec/docker:$extraPath" - '' + optionalString (stdenv.isLinux) '' + '' + optionalString (!clientOnly) '' # symlink docker daemon to docker cli derivation ln -s ${moby}/bin/dockerd $out/bin/dockerd @@ -204,7 +205,7 @@ rec { installManPage man/*/*.[1-9] ''; - passthru.tests = { inherit (nixosTests) docker; }; + passthru.tests = lib.optionals (!clientOnly) { inherit (nixosTests) docker; }; meta = { homepage = "https://www.docker.com/"; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9b9a0199fd67..6b690c6ccaba 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23020,6 +23020,7 @@ in docker = docker_20_10; docker-edge = docker_20_10; + docker-client = docker.override { clientOnly = true; }; docker-proxy = callPackage ../applications/virtualization/docker/proxy.nix { }; |
