3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #18481 from offlinehacker/pkgs/docker/1.12.1

docker: 1.10.3 -> 1.12.1
This commit is contained in:
Jaka Hudoklin 2016-09-13 15:59:18 +02:00 committed by GitHub
commit 7a9dd489d6
7 changed files with 208 additions and 25 deletions

View file

@ -40,13 +40,25 @@ in
};
storageDriver =
mkOption {
type = types.enum ["aufs" "btrfs" "devicemapper" "overlay" "zfs"];
default = "devicemapper";
type = types.nullOr (types.enum ["aufs" "btrfs" "devicemapper" "overlay" "overlay2" "zfs"]);
default = null;
description =
''
This option determines which Docker storage driver to use.
This option determines which Docker storage driver to use. By default
it let's docker automatically choose preferred storage driver.
'';
};
logDriver =
mkOption {
type = types.enum ["none" "json-file" "syslog" "journald" "gelf" "fluentd" "awslogs" "splunk" "etwlogs" "gcplogs"];
default = "journald";
description =
''
This option determines which Docker log driver to use.
'';
};
extraOptions =
mkOption {
type = types.separatedString " ";
@ -88,7 +100,12 @@ in
after = [ "network.target" ] ++ (optional cfg.socketActivation "docker.socket") ;
requires = optional cfg.socketActivation "docker.socket";
serviceConfig = {
ExecStart = "${pkgs.docker}/bin/docker daemon --group=docker --storage-driver=${cfg.storageDriver} ${optionalString cfg.socketActivation "--host=fd://"} ${cfg.extraOptions}";
ExecStart = ''${pkgs.docker}/bin/dockerd \
--group=docker --log-driver=${cfg.logDriver} \
${optionalString (cfg.storageDriver != null) "--storage-driver=${cfg.storageDriver}"} \
${optionalString cfg.socketActivation "--host=fd://"} \
${cfg.extraOptions}
'';
# I'm not sure if that limits aren't too high, but it's what
# goes in config bundled with docker itself
LimitNOFILE = 1048576;

View file

@ -11,9 +11,6 @@ import ./make-test.nix ({ pkgs, ...} : {
{ config, pkgs, ... }:
{
virtualisation.docker.enable = true;
# FIXME: The default "devicemapper" storageDriver fails in NixOS VM
# tests.
virtualisation.docker.storageDriver = "overlay";
};
};

View file

@ -0,0 +1,42 @@
{ stdenv, lib, fetchFromGitHub
, go, libapparmor, apparmor-parser, libseccomp }:
with lib;
stdenv.mkDerivation rec {
name = "containerd-${version}";
version = "0.2.3";
src = fetchFromGitHub {
owner = "docker";
repo = "containerd";
rev = "v${version}";
sha256 = "0hlvbd5n4v337ywkc8mnbhp9m8lg8612krv45262n87c2ijyx09s";
};
buildInputs = [ go ];
preBuild = ''
ln -s $(pwd) vendor/src/github.com/docker/containerd
'';
installPhase = ''
mkdir -p $out/bin
cp bin/* $out/bin
'';
preFixup = ''
# remove references to go compiler
while read file; do
sed -ri "s,${go},$(echo "${go}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" $file
done < <(find $out/bin -type f 2>/dev/null)
'';
meta = {
homepage = https://containerd.tools/;
description = "A daemon to control runC";
license = licenses.asl20;
maintainers = with maintainers; [ offline ];
platforms = platforms.linux;
};
}

View file

@ -1,32 +1,34 @@
{ stdenv, fetchFromGitHub, makeWrapper
, go, sqlite, iproute, bridge-utils, devicemapper
, btrfs-progs, iptables, e2fsprogs, xz, utillinux
, systemd, pkgconfig
{ stdenv, lib, fetchFromGitHub, makeWrapper, pkgconfig, go-md2man
, go, containerd, runc
, sqlite, iproute, bridge-utils, devicemapper, systemd
, btrfs-progs, iptables, e2fsprogs, xz, utillinux, xfsprogs
, procps
}:
# https://github.com/docker/docker/blob/master/project/PACKAGERS.md
with stdenv.lib;
with lib;
stdenv.mkDerivation rec {
name = "docker-${version}";
version = "1.10.3";
version = "1.12.1";
src = fetchFromGitHub {
owner = "docker";
repo = "docker";
rev = "v${version}";
sha256 = "0bmrafi0p3fm681y165ps97jki0a8ihl9f0bmpvi22nmc1v0sv6l";
sha256 = "079786dyydjfc8vb6djxh140pc7v16fjl5x2h2q420qc3mrfz5zd";
};
buildInputs = [
makeWrapper go sqlite iproute bridge-utils devicemapper btrfs-progs
iptables e2fsprogs systemd pkgconfig stdenv.glibc stdenv.glibc.static
makeWrapper pkgconfig go-md2man go
sqlite devicemapper btrfs-progs systemd
];
dontStrip = true;
DOCKER_BUILDTAGS = [ "journald" ]
DOCKER_BUILDTAGS = []
++ optional (systemd != null) [ "journald" ]
++ optional (btrfs-progs == null) "exclude_graphdriver_btrfs"
++ optional (devicemapper == null) "exclude_graphdriver_devicemapper";
@ -39,15 +41,27 @@ stdenv.mkDerivation rec {
buildPhase = ''
patchShebangs .
export AUTO_GOPATH=1
export DOCKER_GITCOMMIT="20f81dde"
export DOCKER_GITCOMMIT="23cf638"
./hack/make.sh dynbinary
'';
outputs = ["out" "man"];
extraPath = makeBinPath [ iproute iptables e2fsprogs xz xfsprogs procps utillinux ];
installPhase = ''
install -Dm755 ./bundles/${version}/dynbinary/docker-${version} $out/libexec/docker/docker
install -Dm755 ./bundles/${version}/dynbinary/dockerinit-${version} $out/libexec/docker/dockerinit
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 : "${stdenv.lib.makeBinPath [ iproute iptables e2fsprogs xz utillinux ]}"
--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
# systemd
install -Dm644 ./contrib/init/systemd/docker.service $out/etc/systemd/system/docker.service
@ -56,9 +70,31 @@ stdenv.mkDerivation rec {
install -Dm644 ./contrib/completion/bash/docker $out/share/bash-completion/completions/docker
install -Dm644 ./contrib/completion/fish/docker.fish $out/share/fish/vendor_completions.d/docker.fish
install -Dm644 ./contrib/completion/zsh/_docker $out/share/zsh/site-functions/_docker
# Include contributed man pages
man/md2man-all.sh -q
manRoot="$man/share/man"
mkdir -p "$manRoot"
for manDir in man/man?; do
manBase="$(basename "$manDir")" # "man1"
for manFile in "$manDir"/*; do
manName="$(basename "$manFile")" # "docker-build.1"
mkdir -p "$manRoot/$manBase"
gzip -c "$manFile" > "$manRoot/$manBase/$manName.gz"
done
done
'';
meta = with stdenv.lib; {
preFixup = ''
# remove references to go compiler, gcc and glibc
while read file; do
sed -ri "s,${go},$(echo "${go}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" $file
sed -ri "s,${stdenv.cc.cc},$(echo "${stdenv.cc.cc}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" $file
sed -ri "s,${stdenv.glibc.dev},$(echo "${stdenv.glibc.dev}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" $file
done < <(find $out -type f 2>/dev/null)
'';
meta = {
homepage = http://www.docker.com/;
description = "An open source project to pack, ship and run any application as a lightweight container";
license = licenses.asl20;

View file

@ -0,0 +1,62 @@
{ stdenv, lib, fetchFromGitHub, go-md2man
, go, pkgconfig, libapparmor, apparmor-parser, libseccomp }:
with lib;
stdenv.mkDerivation rec {
name = "runc-${version}";
version = "2016-06-15";
src = fetchFromGitHub {
owner = "opencontainers";
repo = "runc";
rev = "cc29e3dded8e27ba8f65738f40d251c885030a28";
sha256 = "18fwb3kq10zhhx184yn3j396gpbppy3y4ypb8m2b2pdms39s6pyx";
};
outputs = [ "out" "man" ];
hardeningDisable = ["fortify"];
buildInputs = [ go-md2man go pkgconfig libseccomp libapparmor apparmor-parser ];
makeFlags = ''BUILDTAGS+=seccomp BUILDTAGS+=apparmor'';
preBuild = ''
patchShebangs .
substituteInPlace libcontainer/apparmor/apparmor.go \
--replace /sbin/apparmor_parser ${apparmor-parser}/bin/apparmor_parser
'';
installPhase = ''
install -Dm755 runc $out/bin/runc
# Include contributed man pages
man/md2man-all.sh -q
manRoot="$man/share/man"
mkdir -p "$manRoot"
for manDir in man/man?; do
manBase="$(basename "$manDir")" # "man1"
for manFile in "$manDir"/*; do
manName="$(basename "$manFile")" # "docker-build.1"
mkdir -p "$manRoot/$manBase"
gzip -c "$manFile" > "$manRoot/$manBase/$manName.gz"
done
done
'';
preFixup = ''
# remove references to go compiler
while read file; do
sed -ri "s,${go},$(echo "${go}" | sed "s,$NIX_STORE/[^-]*,$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee,"),g" $file
done < <(find $out/bin -type f 2>/dev/null)
'';
meta = {
homepage = https://runc.io/;
description = "A CLI tool for spawning and running containers according to the OCI specification";
license = licenses.asl20;
maintainers = with maintainers; [ offline ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,25 @@
{ stdenv, lib, buildGoPackage, go, fetchFromGitHub }:
with lib;
buildGoPackage rec {
name = "go-md2man-${version}";
version = "1.0.6";
goPackagePath = "github.com/cpuguy83/go-md2man";
src = fetchFromGitHub {
rev = "v${version}";
owner = "cpuguy83";
repo = "go-md2man";
sha256 = "1rm3zjrmfpzy0l3qp02xmd5pqzl77pdql9pbxhl0k1qw2vfzrjv6";
};
meta = {
description = "Go tool to convert markdown to man pages";
license = licenses.mit;
homepage = https://github.com/cpuguy83/go-md2man;
maintainers = with maintainers; [offline];
platforms = platforms.linux;
};
}

View file

@ -6588,6 +6588,8 @@ in
maven = maven3;
maven3 = callPackage ../development/tools/build-managers/apache-maven { };
go-md2man = callPackage ../development/tools/misc/md2man {};
minify = callPackage ../development/web/minify { };
minizinc = callPackage ../development/tools/minizinc { };
@ -12693,6 +12695,8 @@ in
conkeror-unwrapped = callPackage ../applications/networking/browsers/conkeror { };
conkeror = wrapFirefox conkeror-unwrapped { };
containerd = callPackage ../applications/virtualization/containerd { };
cpp_ethereum = callPackage ../applications/misc/webthree-umbrella {
withOpenCL = true;
@ -12796,9 +12800,7 @@ in
dmtx-utils = callPackage (callPackage ../tools/graphics/dmtx-utils) {
};
docker = callPackage ../applications/virtualization/docker {
btrfs-progs = btrfs-progs_4_4_1;
};
docker = callPackage ../applications/virtualization/docker { };
docker-gc = callPackage ../applications/virtualization/docker/gc.nix { };
@ -14683,6 +14685,8 @@ in
rubyripper = callPackage ../applications/audio/rubyripper {};
runc = callPackage ../applications/virtualization/runc {};
rxvt = callPackage ../applications/misc/rxvt { };
# urxvt