diff options
author | Bastien Rivière <babathriviere@gmail.com> | 2021-10-16 18:19:32 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-16 18:19:32 +0200 |
commit | 33bc6f87068d4bbc843881b6581d8a07e4a424aa (patch) | |
tree | ba5371d25bdd8d39e2fdeba01b156e3ffb698f47 | |
parent | 5d1532c5aa434a0903953003a891e61302d8ac57 (diff) |
docker-compose2: init at 2.0.1 (#141366)
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
-rw-r--r-- | pkgs/applications/virtualization/docker/compose.nix | 26 | ||||
-rw-r--r-- | pkgs/applications/virtualization/docker/default.nix | 16 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 1 |
3 files changed, 37 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 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5071d0567a3b6..2211f09490a5d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -24191,6 +24191,7 @@ with pkgs; afterburn = callPackage ../tools/admin/afterburn {}; docker-buildx = callPackage ../applications/virtualization/docker/buildx.nix { }; + docker-compose_2 = callPackage ../applications/virtualization/docker/compose.nix { }; amazon-ecr-credential-helper = callPackage ../tools/admin/amazon-ecr-credential-helper { }; |