Merge pull request #20656 from vdemeester/docker_1_13

Update to docker 1.13.x
This commit is contained in:
Jaka Hudoklin 2017-01-21 12:19:06 +01:00 committed by GitHub
commit 4884fa4502
4 changed files with 91 additions and 13 deletions

View file

@ -1,5 +1,5 @@
{ stdenv, lib, fetchFromGitHub, makeWrapper, pkgconfig, go-md2man
, go, containerd, runc
, go, containerd, runc, docker-proxy, tini
, sqlite, iproute, bridge-utils, devicemapper, systemd
, btrfs-progs, iptables, e2fsprogs, xz, utillinux, xfsprogs
, procps
@ -11,15 +11,53 @@ with lib;
stdenv.mkDerivation rec {
name = "docker-${version}";
version = "1.12.6";
version = "1.13.0";
src = fetchFromGitHub {
owner = "docker";
repo = "docker";
rev = "v${version}";
sha256 = "10jhjas07xxlxjsxby8865rr0d0zsc5azy16rsz1idmy7f7lk6jh";
sha256 = "03b181xiqgnwanc567w9p6rbdgdvrfv0lk4r7b604ksm0fr4cz23";
};
docker-runc = runc.overrideAttrs (oldAttrs: rec {
name = "docker-runc";
src = fetchFromGitHub {
owner = "docker";
repo = "runc";
rev = "2f7393a47307a16f8cee44a37b262e8b81021e3e";
sha256 = "1s5nfnbinzmcnm8avhvsniz0ihxyva4w5qz1hzzyqdyr0w2scnbj";
};
# docker/runc already include these patches / are not applicable
patches = [];
});
docker-containerd = containerd.overrideAttrs (oldAttrs: rec {
name = "docker-containerd";
src = fetchFromGitHub {
owner = "docker";
repo = "containerd";
rev = "03e5862ec0d8d3b3f750e19fca3ee367e13c090e";
sha256 = "184sd9dwkcba3zhxnz9grw8p81x05977p36cif2dgkhjdhv12map";
};
});
docker-tini = tini.overrideAttrs (oldAttrs: rec {
name = "docker-init";
src = fetchFromGitHub {
owner = "krallin";
repo = "tini";
rev = "949e6facb77383876aeff8a6944dde66b3089574";
sha256 = "0zj4kdis1vvc6dwn4gplqna0bs7v6d1y2zc8v80s3zi018inhznw";
};
# Do not remove static from make files as we want a static binary
patchPhase = ''
'';
NIX_CFLAGS_COMPILE = [
"-DMINIMAL=ON"
];
});
buildInputs = [
makeWrapper pkgconfig go-md2man go
sqlite devicemapper btrfs-progs systemd
@ -52,16 +90,17 @@ stdenv.mkDerivation rec {
installPhase = ''
install -Dm755 ./bundles/${version}/dynbinary-client/docker-${version} $out/libexec/docker/docker
install -Dm755 ./bundles/${version}/dynbinary-daemon/dockerd-${version} $out/libexec/docker/dockerd
install -Dm755 ./bundles/${version}/dynbinary-daemon/docker-proxy-${version} $out/libexec/docker/docker-proxy
makeWrapper $out/libexec/docker/docker $out/bin/docker \
--prefix PATH : "$out/libexec/docker:$extraPath"
makeWrapper $out/libexec/docker/dockerd $out/bin/dockerd \
--prefix PATH : "$out/libexec/docker:$extraPath"
# docker uses containerd now
ln -s ${containerd}/bin/containerd $out/libexec/docker/docker-containerd
ln -s ${containerd}/bin/containerd-shim $out/libexec/docker/docker-containerd-shim
ln -s ${runc}/bin/runc $out/libexec/docker/docker-runc
ln -s ${docker-containerd}/bin/containerd $out/libexec/docker/docker-containerd
ln -s ${docker-containerd}/bin/containerd-shim $out/libexec/docker/docker-containerd-shim
ln -s ${docker-runc}/bin/runc $out/libexec/docker/docker-runc
ln -s ${docker-proxy}/bin/docker-proxy $out/libexec/docker/docker-proxy
ln -s ${docker-tini}/bin/tini-static $out/libexec/docker/docker-init
# systemd
install -Dm644 ./contrib/init/systemd/docker.service $out/etc/systemd/system/docker.service

View file

@ -0,0 +1,36 @@
{ stdenv, lib, fetchFromGitHub, go, docker }:
with lib;
stdenv.mkDerivation rec {
name = "docker-proxy-${rev}";
rev = "0f534354b813003a754606689722fe253101bc4e";
src = fetchFromGitHub {
inherit rev;
owner = "docker";
repo = "libnetwork";
sha256 = "1ah7h417llcq0xzdbp497pchb9m9qvjhrwajcjb0ybrs8v889m31";
};
buildInputs = [ go ];
buildPhase = ''
mkdir -p .gopath/src/github.com/docker
ln -sf $(pwd) .gopath/src/github.com/docker/libnetwork
GOPATH="$(pwd)/.gopath:$(pwd)/Godeps/_workspace" go build -ldflags="$PROXY_LDFLAGS" -o docker-proxy ./cmd/proxy
'';
installPhase = ''
mkdir -p $out/bin
cp docker-proxy $out/bin
'';
meta = {
description = "Docker proxy binary to forward traffic between host and containers";
license = licenses.asl20;
homepage = https://github.com/docker/libnetwork;
maintainers = with maintainers; [vdemeester];
platforms = docker.meta.platforms;
};
}

View file

@ -1,18 +1,20 @@
{ stdenv, fetchurl, cmake }:
{ stdenv, fetchFromGitHub, cmake, glibc }:
stdenv.mkDerivation rec {
version = "0.8.3";
version = "0.13.1";
name = "tini-${version}";
src = fetchurl {
url = "https://github.com/krallin/tini/archive/v0.8.3.tar.gz";
sha256 ="1w7rj4crrcyv25idmh4asbp2sxzwyihy5mbpw384bzxjzaxn9xpa";
src = fetchFromGitHub {
owner = "krallin";
repo = "tini";
rev = "v${version}";
sha256 ="1g4n8v5d197zcb41fcpbhip2x342383zw1d2zkv57w73vkqgv6z6";
};
patchPhase = "sed -i /tini-static/d CMakeLists.txt";
NIX_CFLAGS_COMPILE = [
"-DPR_SET_CHILD_SUBREAPER=36"
"-DPR_GET_CHILD_SUBREAPER=37"
];
buildInputs = [ cmake ];
buildInputs = [ cmake glibc glibc.static ];
meta = with stdenv.lib; {
description = "A tiny but valid init for containers";
homepage = https://github.com/krallin/tini;

View file

@ -12832,6 +12832,7 @@ in
};
docker = callPackage ../applications/virtualization/docker { };
docker-proxy = callPackage ../applications/virtualization/docker/proxy.nix { };
docker-gc = callPackage ../applications/virtualization/docker/gc.nix { };