My personal project and infrastructure archive
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nomicon/pkgs/applications/virtualization/docker/default.nix

54 lines
1.9 KiB

{ stdenv, fetchFromGitHub, makeWrapper, go, lxc, sqlite, iproute, bridge-utils, devicemapper,
btrfsProgs, iptables, bash, e2fsprogs, xz, utillinux}:
11 years ago
# https://github.com/docker/docker/blob/master/project/PACKAGERS.md
11 years ago
stdenv.mkDerivation rec {
name = "docker-${version}";
version = "1.8.1";
11 years ago
src = fetchFromGitHub {
owner = "docker";
repo = "docker";
rev = "v${version}";
sha256 = "0nwd5wsw9f50jh4s5c5sfd6hnyh3g2kmxcrid36y1phabh30yrcz";
11 years ago
};
buildInputs = [ makeWrapper go sqlite lxc iproute bridge-utils devicemapper btrfsProgs iptables e2fsprogs ];
11 years ago
dontStrip = true;
11 years ago
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
'';
11 years ago
buildPhase = ''
patchShebangs .
export AUTO_GOPATH=1
export DOCKER_GITCOMMIT="786b29d4"
./hack/make.sh dynbinary
11 years ago
'';
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"
11 years ago
# 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; {
homepage = http://www.docker.com/;
11 years ago
description = "An open source project to pack, ship and run any application as a lightweight container";
license = licenses.asl20;
maintainers = with maintainers; [ offline tailhook ];
11 years ago
platforms = platforms.linux;
};
}