3
0
Fork 0
forked from mirrors/nixpkgs

docker: make lxc optional

This commit is contained in:
Jaka Hudoklin 2015-11-16 16:17:32 +01:00
parent 88f5cfc126
commit 02fc10ce25

View file

@ -1,8 +1,13 @@
{ stdenv, fetchFromGitHub, makeWrapper, go, lxc, sqlite, iproute, bridge-utils, devicemapper,
btrfsProgs, iptables, bash, e2fsprogs, xz, utillinux}:
{ stdenv, fetchFromGitHub, makeWrapper
, go, sqlite, iproute, bridge-utils, devicemapper
, btrfsProgs, iptables, e2fsprogs, xz, utillinux
, enableLxc ? false, lxc
}:
# https://github.com/docker/docker/blob/master/project/PACKAGERS.md
with stdenv.lib;
stdenv.mkDerivation rec {
name = "docker-${version}";
version = "1.8.1";
@ -14,7 +19,10 @@ stdenv.mkDerivation rec {
sha256 = "0nwd5wsw9f50jh4s5c5sfd6hnyh3g2kmxcrid36y1phabh30yrcz";
};
buildInputs = [ makeWrapper go sqlite lxc iproute bridge-utils devicemapper btrfsProgs iptables e2fsprogs ];
buildInputs = [
makeWrapper go sqlite iproute bridge-utils devicemapper btrfsProgs
iptables e2fsprogs
];
dontStrip = true;
@ -33,7 +41,8 @@ stdenv.mkDerivation rec {
installPhase = ''
install -Dm755 ./bundles/${version}/dynbinary/docker-${version} $out/libexec/docker/docker
install -Dm755 ./bundles/${version}/dynbinary/dockerinit-${version} $out/libexec/docker/dockerinit
makeWrapper $out/libexec/docker/docker $out/bin/docker --prefix PATH : "${iproute}/sbin:sbin:${lxc}/bin:${iptables}/sbin:${e2fsprogs}/sbin:${xz}/bin:${utillinux}/bin"
makeWrapper $out/libexec/docker/docker $out/bin/docker \
--prefix PATH : "${iproute}/sbin:sbin:${iptables}/sbin:${e2fsprogs}/sbin:${xz}/bin:${utillinux}/bin:${optionalString enableLxc "${lxc}/bin"}"
# systemd
install -Dm644 ./contrib/init/systemd/docker.service $out/etc/systemd/system/docker.service