nixpkgs/pkgs/applications/virtualization/docker/default.nix

62 lines
2 KiB
Nix
Raw Normal View History

2015-11-16 16:17:32 +01:00
{ stdenv, fetchFromGitHub, makeWrapper
, go, sqlite, iproute, bridge-utils, devicemapper
2016-01-03 19:21:27 +01:00
, btrfs-progs, iptables, e2fsprogs, xz, utillinux
2016-01-14 03:40:26 +01:00
, systemd, pkgconfig
2015-11-16 16:17:32 +01:00
}:
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
2015-11-16 16:17:32 +01:00
with stdenv.lib;
2014-01-24 14:39:43 +01:00
stdenv.mkDerivation rec {
name = "docker-${version}";
2016-03-18 22:12:42 +01:00
version = "1.10.3";
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}";
2016-03-18 22:12:42 +01:00
sha256 = "0bmrafi0p3fm681y165ps97jki0a8ihl9f0bmpvi22nmc1v0sv6l";
2014-01-24 14:39:43 +01:00
};
2015-11-16 16:17:32 +01:00
buildInputs = [
2016-01-03 19:21:27 +01:00
makeWrapper go sqlite iproute bridge-utils devicemapper btrfs-progs
iptables e2fsprogs systemd pkgconfig stdenv.glibc stdenv.glibc.static
2015-11-16 16:17:32 +01:00
];
2014-01-24 14:39:43 +01:00
dontStrip = true;
2014-01-24 14:39:43 +01:00
DOCKER_BUILDTAGS = [ "journald" ]
++ optional (btrfs-progs == null) "exclude_graphdriver_btrfs"
++ optional (devicemapper == null) "exclude_graphdriver_devicemapper";
2016-01-14 03:40:26 +01:00
2014-01-24 14:39:43 +01:00
buildPhase = ''
2015-05-10 12:26:53 +02:00
patchShebangs .
export AUTO_GOPATH=1
2015-11-24 16:13:57 +01:00
export DOCKER_GITCOMMIT="a34a1d59"
2015-04-25 15:46:35 +02:00
./hack/make.sh dynbinary
2014-01-24 14:39:43 +01:00
'';
installPhase = ''
install -Dm755 ./bundles/${version}/dynbinary/docker-${version} $out/libexec/docker/docker
install -Dm755 ./bundles/${version}/dynbinary/dockerinit-${version} $out/libexec/docker/dockerinit
2015-11-16 16:17:32 +01:00
makeWrapper $out/libexec/docker/docker $out/bin/docker \
--prefix PATH : "${iproute}/sbin:sbin:${iptables}/sbin:${e2fsprogs}/sbin:${xz.bin}/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;
maintainers = with maintainers; [ offline tailhook ];
2014-01-24 14:39:43 +01:00
platforms = platforms.linux;
};
}