docker-compose2: init at 2.0.1 (#141366)

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
This commit is contained in:
Bastien Rivière 2021-10-16 18:19:32 +02:00 committed by GitHub
parent 5d1532c5aa
commit 33bc6f8706
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 37 additions and 6 deletions

View file

@ -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 ];
};
}

View file

@ -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

View file

@ -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 { };