2015-08-04 05:16:03 +02:00
|
|
|
{ stdenv, fetchFromGitHub, makeWrapper, go, lxc, sqlite, iproute, bridge-utils, devicemapper,
|
2015-08-29 18:25:39 +02:00
|
|
|
btrfsProgs, iptables, bash, e2fsprogs, xz, utillinux}:
|
2014-01-24 14:39:43 +01:00
|
|
|
|
2015-08-27 13:22:29 +02:00
|
|
|
# https://github.com/docker/docker/blob/master/project/PACKAGERS.md
|
|
|
|
|
2014-01-24 14:39:43 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "docker-${version}";
|
2015-08-26 13:55:57 +02:00
|
|
|
version = "1.8.1";
|
2014-01-24 14:39:43 +01:00
|
|
|
|
2015-08-04 05:16:03 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "docker";
|
|
|
|
repo = "docker";
|
|
|
|
rev = "v${version}";
|
2015-08-26 13:55:57 +02:00
|
|
|
sha256 = "0nwd5wsw9f50jh4s5c5sfd6hnyh3g2kmxcrid36y1phabh30yrcz";
|
2014-01-24 14:39:43 +01:00
|
|
|
};
|
|
|
|
|
2015-02-20 21:43:09 +01:00
|
|
|
buildInputs = [ makeWrapper go sqlite lxc iproute bridge-utils devicemapper btrfsProgs iptables e2fsprogs ];
|
2014-01-24 14:39:43 +01:00
|
|
|
|
2014-07-28 00:00:59 +02:00
|
|
|
dontStrip = true;
|
2014-01-24 14:39:43 +01:00
|
|
|
|
2015-08-27 13:22:29 +02:00
|
|
|
preConfigure = ''
|
|
|
|
mv vendor/src/github.com/opencontainers/runc/libcontainer/seccomp/{jump_amd64.go,jump_linux.go}
|
|
|
|
sed -i 's/,amd64//' vendor/src/github.com/opencontainers/runc/libcontainer/seccomp/jump_linux.go
|
|
|
|
'';
|
|
|
|
|
2014-01-24 14:39:43 +01:00
|
|
|
buildPhase = ''
|
2015-05-10 12:26:53 +02:00
|
|
|
patchShebangs .
|
2014-04-07 07:33:34 +02:00
|
|
|
export AUTO_GOPATH=1
|
2015-08-04 05:16:03 +02:00
|
|
|
export DOCKER_GITCOMMIT="786b29d4"
|
2015-04-25 15:46:35 +02:00
|
|
|
./hack/make.sh dynbinary
|
2014-01-24 14:39:43 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2014-09-03 18:24:51 +02:00
|
|
|
install -Dm755 ./bundles/${version}/dynbinary/docker-${version} $out/libexec/docker/docker
|
|
|
|
install -Dm755 ./bundles/${version}/dynbinary/dockerinit-${version} $out/libexec/docker/dockerinit
|
2015-08-29 18:25:39 +02:00
|
|
|
makeWrapper $out/libexec/docker/docker $out/bin/docker --prefix PATH : "${iproute}/sbin:sbin:${lxc}/bin:${iptables}/sbin:${e2fsprogs}/sbin:${xz}/bin:${utillinux}/bin"
|
2014-01-24 14:39:43 +01:00
|
|
|
|
|
|
|
# systemd
|
|
|
|
install -Dm644 ./contrib/init/systemd/docker.service $out/etc/systemd/system/docker.service
|
|
|
|
|
|
|
|
# completion
|
|
|
|
install -Dm644 ./contrib/completion/bash/docker $out/share/bash-completion/completions/docker
|
|
|
|
install -Dm644 ./contrib/completion/zsh/_docker $out/share/zsh/site-functions/_docker
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2015-08-04 05:16:03 +02:00
|
|
|
homepage = http://www.docker.com/;
|
2014-01-24 14:39:43 +01:00
|
|
|
description = "An open source project to pack, ship and run any application as a lightweight container";
|
|
|
|
license = licenses.asl20;
|
2014-07-28 00:00:59 +02:00
|
|
|
maintainers = with maintainers; [ offline tailhook ];
|
2014-01-24 14:39:43 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|