diff options
Diffstat (limited to 'pkgs/applications/virtualization/docker')
-rw-r--r-- | pkgs/applications/virtualization/docker/compose.nix | 26 | ||||
-rw-r--r-- | pkgs/applications/virtualization/docker/default.nix | 16 |
2 files changed, 36 insertions, 6 deletions
diff --git a/pkgs/applications/virtualization/docker/compose.nix b/pkgs/applications/virtualization/docker/compose.nix new file mode 100644 index 0000000000000..3ce3d9a880f8b --- /dev/null +++ b/pkgs/applications/virtualization/docker/compose.nix @@ -0,0 +1,26 @@ +{ lib, buildGoModule, fetchFromGitHub }: + +buildGoModule rec { + pname = "docker-compose"; + version = "2.0.1"; + + src = fetchFromGitHub { + owner = "docker"; + repo = "compose"; + rev = "v${version}"; + sha256 = "sha256-6OjA3f6c9s/86UPxy9EqLIc/0ZuW6UhKyQdkM7YoTsU="; + }; + + vendorSha256 = "sha256-6h36TZmo0RvB3YzZRmsrs2Fbl+8zPTuL9LxWkuNgRqw="; + + doCheck = false; + installPhase = '' + install -D $GOPATH/bin/cmd $out/libexec/docker/cli-plugins/docker-compose + ''; + + meta = with lib; { + description = "Docker CLI plugin to define and run multi-container applications with Docker"; + license = licenses.asl20; + maintainers = [ maintainers.babariviere ]; + }; +} diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix index 24bd7a1339aa1..8345b2b42d76e 100644 --- a/pkgs/applications/virtualization/docker/default.nix +++ b/pkgs/applications/virtualization/docker/default.nix @@ -8,16 +8,16 @@ rec { , moby-src , runcRev, runcSha256 , containerdRev, containerdSha256 - , tiniRev, tiniSha256, buildxSupport ? true + , tiniRev, tiniSha256, buildxSupport ? true, composeSupport ? true # package dependencies , stdenv, fetchFromGitHub, buildGoPackage , makeWrapper, installShellFiles, pkg-config, glibc , go-md2man, go, containerd_1_4, runc, docker-proxy, tini, libtool - , sqlite, iproute2, lvm2, systemd, docker-buildx + , sqlite, iproute2, lvm2, systemd, docker-buildx, docker-compose_2 , btrfs-progs, iptables, e2fsprogs, xz, util-linux, xfsprogs, git , procps, libseccomp , nixosTests - , clientOnly ? !stdenv.isLinux + , clientOnly ? !stdenv.isLinux, symlinkJoin }: let docker-runc = runc.overrideAttrs (oldAttrs: { @@ -117,6 +117,10 @@ rec { ++ optional (lvm2 == null) "exclude_graphdriver_devicemapper" ++ optional (libseccomp != null) "seccomp"; }); + + plugins = optionals buildxSupport [ docker-buildx ] + ++ optionals composeSupport [ docker-compose_2 ]; + pluginsRef = symlinkJoin { name = "docker-plugins"; paths = plugins; }; in buildGoPackage ((optionalAttrs (!clientOnly) { @@ -141,14 +145,14 @@ rec { ]; buildInputs = optionals (!clientOnly) [ sqlite lvm2 btrfs-progs systemd libseccomp - ] ++ optionals (buildxSupport) [ docker-buildx ]; + ] ++ plugins; postPatch = '' patchShebangs man scripts/build/ substituteInPlace ./scripts/build/.variables --replace "set -eu" "" - '' + optionalString buildxSupport '' + '' + optionalString (plugins != []) '' substituteInPlace ./cli-plugins/manager/manager_unix.go --replace /usr/libexec/docker/cli-plugins \ - ${lib.strings.makeSearchPathOutput "bin" "libexec/docker/cli-plugins" [docker-buildx]} + "${pluginsRef}/libexec/docker/cli-plugins" ''; # Keep eyes on BUILDTIME format - https://github.com/docker/cli/blob/${version}/scripts/build/.variables |