Merge pull request #107302 from bobrik/ivan/docker-buildx

This commit is contained in:
Sandro 2021-01-22 12:50:25 +01:00 committed by GitHub
commit 0c096b67dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 41 additions and 3 deletions

View file

@ -3887,6 +3887,12 @@
githubId = 4458;
name = "Ivan Kozik";
};
ivan-babrou = {
email = "nixpkgs@ivan.computer";
name = "Ivan Babrou";
github = "bobrik";
githubId = 89186;
};
ivan-timokhin = {
email = "nixpkgs@ivan.timokhin.name";
name = "Ivan Timokhin";

View file

@ -0,0 +1,25 @@
{ stdenv, lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "docker-buildx";
version = "0.5.1";
src = fetchFromGitHub {
owner = "docker";
repo = "buildx";
rev = "v${version}";
sha256 = "0l03ncs1x4lhgy0kf7bd1zq00md8fi93f8xq6k0ans4400divfzk";
};
vendorSha256 = null;
installPhase = ''
install -D $GOPATH/bin/buildx $out/libexec/docker/cli-plugins/docker-buildx
'';
meta = with lib; {
description = "Docker CLI plugin for extended build capabilities with BuildKit";
license = licenses.asl20;
maintainers = [ maintainers.ivan-babrou ];
};
}

View file

@ -1,10 +1,11 @@
{ stdenv, lib, fetchFromGitHub, fetchpatch, buildGoPackage
, makeWrapper, installShellFiles, pkg-config
, go-md2man, go, containerd, runc, docker-proxy, tini, libtool
, sqlite, iproute, lvm2, systemd
, sqlite, iproute, lvm2, systemd, docker-buildx
, btrfs-progs, iptables, e2fsprogs, xz, util-linux, xfsprogs, git
, procps, libseccomp
, nixosTests
, buildxSupport ? false
}:
with lib;
@ -15,7 +16,7 @@ rec {
, mobyRev, mobySha256
, runcRev, runcSha256
, containerdRev, containerdSha256
, tiniRev, tiniSha256
, tiniRev, tiniSha256, buildxSupport
} :
let
docker-runc = runc.overrideAttrs (oldAttrs: {
@ -142,7 +143,7 @@ rec {
makeWrapper
] ++ optionals (stdenv.isLinux) [
sqlite lvm2 btrfs-progs systemd libseccomp
];
] ++ optionals (buildxSupport) [ docker-buildx ];
# Keep eyes on BUILDTIME format - https://github.com/docker/cli/blob/${version}/scripts/build/.variables
buildPhase = ''
@ -167,6 +168,9 @@ rec {
substituteInPlace ./scripts/build/.variables --replace "set -eu" ""
substituteInPlace ./scripts/docs/generate-man.sh --replace "-v md2man" "-v go-md2man"
substituteInPlace ./man/md2man-all.sh --replace md2man go-md2man
'' + optionalString buildxSupport ''
substituteInPlace ./components/cli/cli-plugins/manager/manager_unix.go --replace /usr/libexec/docker/cli-plugins \
${lib.strings.makeSearchPathOutput "bin" "libexec/docker/cli-plugins" [docker-buildx]}
'';
outputs = ["out" "man"];
@ -224,5 +228,6 @@ rec {
containerdSha256 = "09xvhjg5f8h90w1y94kqqnqzhbhd62dcdd9wb9sdqakisjk6zrl0";
tiniRev = "de40ad007797e0dcd8b7126f27bb87401d224240"; # v0.19.0
tiniSha256 = "1h20i3wwlbd8x4jr2gz68hgklh0lb0jj7y5xk1wvr8y58fip1rdn";
inherit buildxSupport;
};
}

View file

@ -21446,6 +21446,8 @@ in
afterburn = callPackage ../tools/admin/afterburn {};
docker-buildx = callPackage ../applications/virtualization/docker/buildx.nix { };
amazon-ecr-credential-helper = callPackage ../tools/admin/amazon-ecr-credential-helper { };
docker-credential-gcr = callPackage ../tools/admin/docker-credential-gcr { };