Merge pull request #1665 from crawford/docker

app-emulation/docker: bump to v1.9.1 with backport
This commit is contained in:
Alex Crawford 2015-11-25 11:15:36 -08:00
commit f9ae48b8d7
2 changed files with 63 additions and 48 deletions

View File

@ -1,12 +1,9 @@
# Copyright 1999-2014 Gentoo Foundation # Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2 # Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-emulation/docker/docker-1.4.0.ebuild,v 1.1 2014/12/12 18:53:23 xarthisius Exp $ # $Id$
EAPI=5 EAPI=5
DESCRIPTION="Docker complements kernel namespacing with a high-level API which operates at the process level"
HOMEPAGE="https://www.docker.com"
CROS_WORKON_PROJECT="coreos/docker" CROS_WORKON_PROJECT="coreos/docker"
CROS_WORKON_LOCALNAME="docker" CROS_WORKON_LOCALNAME="docker"
CROS_WORKON_REPO="git://github.com" CROS_WORKON_REPO="git://github.com"
@ -15,31 +12,33 @@ if [[ ${PV} == *9999 ]]; then
DOCKER_GITCOMMIT="unknown" DOCKER_GITCOMMIT="unknown"
KEYWORDS="~amd64 ~arm64" KEYWORDS="~amd64 ~arm64"
else else
CROS_WORKON_COMMIT="cedd53482c5a3ce88f3bb98d1d325dae4c95d9b6" # v1.8.3 with backports CROS_WORKON_COMMIT="4419fdb3c51f39931f757e3ec8518c036cf514f9" # v1.9.1 with backports
DOCKER_GITCOMMIT="${CROS_WORKON_COMMIT:0:7}" DOCKER_GITCOMMIT="${CROS_WORKON_COMMIT:0:7}"
KEYWORDS="amd64" KEYWORDS="amd64"
fi fi
inherit bash-completion-r1 linux-info multilib systemd udev user cros-workon inherit bash-completion-r1 eutils linux-info multilib systemd udev user cros-workon
DESCRIPTION="Docker complements kernel namespacing with a high-level API which operates at the process level"
HOMEPAGE="https://dockerproject.org"
LICENSE="Apache-2.0" LICENSE="Apache-2.0"
SLOT="0" SLOT="0"
IUSE="aufs +btrfs contrib +device-mapper doc experimental lxc +overlay +selinux vim-syntax zsh-completion" IUSE="apparmor aufs +btrfs contrib +device-mapper experimental lxc +overlay +selinux vim-syntax zsh-completion"
# https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#build-dependencies # https://github.com/docker/docker/blob/master/hack/PACKAGERS.md#build-dependencies
CDEPEND=" CDEPEND="
>=sys-kernel/coreos-kernel-3.18.0
>=dev-db/sqlite-3.7.9:3 >=dev-db/sqlite-3.7.9:3
device-mapper? ( device-mapper? (
>=sys-fs/lvm2-2.02.89[thin] >=sys-fs/lvm2-2.02.89[thin]
) )
" "
#dev-go/go-md2man
DEPEND=" DEPEND="
${CDEPEND} ${CDEPEND}
>=dev-lang/go-1.3
btrfs? ( btrfs? (
>=sys-fs/btrfs-progs-3.16.1 >=sys-fs/btrfs-progs-3.8
) )
" "
@ -62,11 +61,9 @@ RDEPEND="
lxc? ( lxc? (
>=app-emulation/lxc-1.0.7 >=app-emulation/lxc-1.0.7
) )
aufs? (
|| ( apparmor? (
sys-fs/aufs3 sys-libs/libapparmor[static-libs]
sys-kernel/aufs-sources
)
) )
" "
@ -76,32 +73,37 @@ RESTRICT="installsources strip"
CONFIG_CHECK=" CONFIG_CHECK="
~NAMESPACES ~NET_NS ~PID_NS ~IPC_NS ~UTS_NS ~NAMESPACES ~NET_NS ~PID_NS ~IPC_NS ~UTS_NS
~DEVPTS_MULTIPLE_INSTANCES ~DEVPTS_MULTIPLE_INSTANCES
~CGROUPS ~CGROUP_CPUACCT ~CGROUP_DEVICE ~CGROUP_FREEZER ~CGROUP_SCHED ~CGROUPS ~CGROUP_CPUACCT ~CGROUP_DEVICE ~CGROUP_FREEZER ~CGROUP_SCHED ~CPUSETS ~MEMCG
~CPUSETS ~MACVLAN ~VETH ~BRIDGE ~BRIDGE_NETFILTER
~MACVLAN ~VETH ~BRIDGE
~NF_NAT_IPV4 ~IP_NF_FILTER ~IP_NF_TARGET_MASQUERADE ~NF_NAT_IPV4 ~IP_NF_FILTER ~IP_NF_TARGET_MASQUERADE
~NETFILTER_XT_MATCH_ADDRTYPE ~NETFILTER_XT_MATCH_CONNTRACK ~NETFILTER_XT_MATCH_ADDRTYPE ~NETFILTER_XT_MATCH_CONNTRACK
~NF_NAT ~NF_NAT_NEEDED ~NF_NAT ~NF_NAT_NEEDED
~POSIX_MQUEUE ~POSIX_MQUEUE
~MEMCG_SWAP ~MEMCG_SWAP_ENABLED ~MEMCG_KMEM ~MEMCG_SWAP ~MEMCG_SWAP_ENABLED
~RESOURCE_COUNTERS
~BLK_CGROUP ~IOSCHED_CFQ
~CGROUP_PERF ~CGROUP_PERF
~CFS_BANDWIDTH ~CGROUP_HUGETLB
~NET_CLS_CGROUP
~CFS_BANDWIDTH ~FAIR_GROUP_SCHED ~RT_GROUP_SCHED
" "
ERROR_MEMCG_KMEM="CONFIG_MEMCG_KMEM: is optional"
ERROR_MEMCG_SWAP="CONFIG_MEMCG_SWAP: is required if you wish to limit swap usage of containers" ERROR_MEMCG_SWAP="CONFIG_MEMCG_SWAP: is required if you wish to limit swap usage of containers"
ERROR_RESOURCE_COUNTERS="CONFIG_RESOURCE_COUNTERS: is optional for container statistics gathering" ERROR_RESOURCE_COUNTERS="CONFIG_RESOURCE_COUNTERS: is optional for container statistics gathering"
ERROR_BLK_CGROUP="CONFIG_BLK_CGROUP: is optional for container statistics gathering"
ERROR_IOSCHED_CFQ="CONFIG_IOSCHED_CFQ: is optional for container statistics gathering"
ERROR_CGROUP_PERF="CONFIG_CGROUP_PERF: is optional for container statistics gathering" ERROR_CGROUP_PERF="CONFIG_CGROUP_PERF: is optional for container statistics gathering"
ERROR_CFS_BANDWIDTH="CONFIG_CFS_BANDWIDTH: is optional for container statistics gathering" ERROR_CFS_BANDWIDTH="CONFIG_CFS_BANDWIDTH: is optional for container statistics gathering"
pkg_setup() { pkg_setup() {
if kernel_is lt 3 8; then if kernel_is lt 3 10; then
eerror "" ewarn ""
eerror "Using Docker with kernels older than 3.8 is unstable and unsupported." ewarn "Using Docker with kernels older than 3.10 is unstable and unsupported."
eerror " - http://docs.docker.com/installation/binaries/#check-kernel-dependencies" ewarn " - http://docs.docker.com/installation/binaries/#check-kernel-dependencies"
die 'Kernel is too old - need 3.8 or above'
fi fi
# for where these kernel versions come from, see: # for where these kernel versions come from, see:
@ -119,14 +121,28 @@ pkg_setup() {
ewarn "See also https://github.com/docker/docker/issues/2960" ewarn "See also https://github.com/docker/docker/issues/2960"
fi fi
if kernel_is le 3 18; then
CONFIG_CHECK+="
~RESOURCE_COUNTERS
"
fi
if kernel_is le 3 13; then
CONFIG_CHECK+="
~NETPRIO_CGROUP
"
else
CONFIG_CHECK+="
~CGROUP_NET_PRIO
"
fi
if use aufs; then if use aufs; then
CONFIG_CHECK+=" CONFIG_CHECK+="
~AUFS_FS ~AUFS_FS
~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
" "
# TODO there must be a way to detect "sys-kernel/aufs-sources" so we don't warn "sys-fs/aufs3" users about this ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs-sources are used instead of aufs4/aufs3"
# an even better solution would be to check if the current kernel sources include CONFIG_AUFS_FS as an option, but that sounds hairy and error-prone
ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs-sources are used"
fi fi
if use btrfs; then if use btrfs; then
@ -148,6 +164,9 @@ pkg_setup() {
fi fi
linux-info_pkg_setup linux-info_pkg_setup
# create docker group for the code checking for it in /etc/group
enewgroup docker
} }
src_prepare() { src_prepare() {
@ -191,6 +210,9 @@ src_compile() {
if use selinux; then if use selinux; then
DOCKER_BUILDTAGS+=" selinux" DOCKER_BUILDTAGS+=" selinux"
fi fi
if use apparmor; then
DOCKER_BUILDTAGS+=' apparmor'
fi
# https://github.com/docker/docker/pull/13338 # https://github.com/docker/docker/pull/13338
if use experimental; then if use experimental; then
@ -207,14 +229,15 @@ src_compile() {
# time to build! # time to build!
./hack/make.sh dynbinary || die 'dynbinary failed' ./hack/make.sh dynbinary || die 'dynbinary failed'
# TODO get go-md2man and then include the man pages using docs/man/md2man-all.sh # build the man pages too
#./man/md2man-all.sh || die "unable to generate man pages"
} }
src_install() { src_install() {
VERSION=$(cat VERSION) VERSION="$(cat VERSION)"
newbin bundles/$VERSION/dynbinary/docker-$VERSION docker newbin "bundles/$VERSION/dynbinary/docker-$VERSION" docker
exeinto /usr/libexec/docker exeinto /usr/libexec/docker
newexe bundles/$VERSION/dynbinary/dockerinit-$VERSION dockerinit newexe "bundles/$VERSION/dynbinary/dockerinit-$VERSION" dockerinit
newinitd contrib/init/openrc/docker.initd docker newinitd contrib/init/openrc/docker.initd docker
newconfd contrib/init/openrc/docker.confd docker newconfd contrib/init/openrc/docker.confd docker
@ -234,13 +257,8 @@ src_install() {
udev_dorules contrib/udev/*.rules udev_dorules contrib/udev/*.rules
dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
if use doc; then dodoc -r docs/*
# TODO doman contrib/man/man*/* #doman man/man*/*
docompress -x /usr/share/doc/${PF}/md
docinto md
dodoc -r docs/sources/*
fi
dobashcomp contrib/completion/bash/* dobashcomp contrib/completion/bash/*
@ -256,6 +274,7 @@ src_install() {
fi fi
if use contrib; then if use contrib; then
# note: intentionally not using "doins" so that we preserve +x bits
mkdir -p "${D}/usr/share/${PN}/contrib" mkdir -p "${D}/usr/share/${PN}/contrib"
cp -R contrib/* "${D}/usr/share/${PN}/contrib" cp -R contrib/* "${D}/usr/share/${PN}/contrib"
fi fi
@ -264,18 +283,14 @@ src_install() {
pkg_postinst() { pkg_postinst() {
udev_reload udev_reload
elog "" elog
elog "To use Docker, the Docker daemon must be running as root. To automatically" elog "To use Docker, the Docker daemon must be running as root. To automatically"
elog "start the Docker daemon at boot, add Docker to the default runlevel:" elog "start the Docker daemon at boot, add Docker to the default runlevel:"
elog " rc-update add docker default" elog " rc-update add docker default"
elog "Similarly for systemd:" elog "Similarly for systemd:"
elog " systemctl enable docker.service" elog " systemctl enable docker.service"
elog "" elog
# create docker group if the code checking for it in /etc/group exists
enewgroup docker
elog "To use Docker as a non-root user, add yourself to the 'docker' group:" elog "To use Docker as a non-root user, add yourself to the 'docker' group:"
elog " usermod -aG docker youruser" elog " usermod -aG docker youruser"
elog "" elog
} }