summaryrefslogtreecommitdiff
path: root/app-emulation/docker
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-11-03 08:36:22 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-11-03 08:36:22 +0000
commitf65628136faa35d0c4d3b5e7332275c7b35fcd96 (patch)
tree021998302365c5652e37824b6c26d4d969a62055 /app-emulation/docker
parent70b82ae359a5538711e103b0e8dfb92654296644 (diff)
gentoo resync : 03.11.2018
Diffstat (limited to 'app-emulation/docker')
-rw-r--r--app-emulation/docker/Manifest3
-rw-r--r--app-emulation/docker/docker-18.03.1-r1.ebuild303
-rw-r--r--app-emulation/docker/docker-18.06.1-r1.ebuild305
-rw-r--r--app-emulation/docker/files/bsc1073877-docker-apparmor-add-signal-r2.patch72
4 files changed, 683 insertions, 0 deletions
diff --git a/app-emulation/docker/Manifest b/app-emulation/docker/Manifest
index c415d07d12e0..ac7c4338ac6b 100644
--- a/app-emulation/docker/Manifest
+++ b/app-emulation/docker/Manifest
@@ -1,9 +1,12 @@
+AUX bsc1073877-docker-apparmor-add-signal-r2.patch 2931 BLAKE2B 92737eb582f5c2b3bc548952e20f8b9512ea3abab785280a351202878a77fc5e7c00267498ac38cd13dfb5b21a891f5be827f8f4ed234ca34bb90523cd2ebacf SHA512 f1c57585146d89be987b19ebd99a0da69d75309885e3b2a098c1b5f339aafa360c3726fe5e99a2580c98c3f036d83eabd3d2d72461d97e8a0cbb4dbc27f895d4
AUX bsc1073877-docker-apparmor-add-signal.patch 715 BLAKE2B cb97ebb2e7104e04264318fec93df80a5f7f9b4cfc84b9f31ea1185d7752e431d714dd901b168c490562688c124aac8d48fef9c1266d7a8fa07aa06de7e40d08 SHA512 936d3948fd3ccadd4a3810bb8fc32e31e7e24b810e87658e5e53560b515454db6b72b0cda3ace78b9267e197e55181c04fbea92a1656f6a282e29f37d2994adc
DIST docker-18.03.1.tar.gz 12758590 BLAKE2B 98213af07b945fda536e321ef5cc9e272848aab97dcadb7a6b1433b9310fa78015794b5ee4f255448251366a7811e97248b9cc90b0225c528249188768f344ab SHA512 48c4916421cd500ada1bfc2207123a29870939a15a1c7c4a0c082f61c1e3e063381e2345ee9df645dbaca49e002dbfaba70cf6fe233b39a4e1f44fb015807e10
DIST docker-18.06.0.tar.gz 13656557 BLAKE2B cc5e28d47eca07a42f040d8b47de25a35403e9e0451ca57eddcf1b6721169eb9bc41d4f4b5aad355f4394534e339ccbc83c6fb6d4df750c9738f1aa2466f90ef SHA512 d5bd6a83126c4dba14c775533b6c9bda35af2cd97db13922b3766494ce10dd9316d0167c87a6683dede28ea063f9435a0a009b96e413dad8abc7884a3468d589
DIST docker-18.06.1.tar.gz 13672693 BLAKE2B 7aed2f409914471b3e0eec4f3d024bf59e6505060c1da9c4bb68f0d6efdb5286a8e9e5ee0de19b3f0165c965db27d409f72fceb3f792fc91b9b8dddc8a2b01f0 SHA512 7375452669bf6576e1f8d193cd7f421cf39a26d575351f2b4e433c7fc89384f441547417dbe8c12a12a0937c9fea3800b5c541f0ba8b58ceffe7445183ceeef1
+EBUILD docker-18.03.1-r1.ebuild 8338 BLAKE2B e9984640c084a99c1ba99173905b9d58f14559b0b122bb6759b16689bf40fc313d0b9a3fac45ceaf509fe28b7006c87b555c3db49c32f04360e700cca4cbb839 SHA512 1d11e2d4f67d8e16714901e56ce251d590ea2be3a786869895600a3bee4becc0f66dc88b6253df1c277455e595851ac34e608b70f46bbe88e0a33f3e17eaf4ac
EBUILD docker-18.03.1.ebuild 8337 BLAKE2B f0b13adc75d2a334eaf91938b2774a5216fa4ef7905032f59e313d87367c7de07a6868e443f65db881bbeaabc8aeaf008aec8836827513b546ddd3bfeab599d7 SHA512 09645b50f569e37e94c7f8e36503ce949fe709ff22d579b9e2e2183a573196ae3bdf0a991c71af56a37e2e8fa7e3341289154dee4e1a336ea1b212cd63079bc9
EBUILD docker-18.06.0.ebuild 8445 BLAKE2B 1f51219ccefc26a7c256122a54afcbf272951190e8b1ec9c79bdb2e3b25a67fd3ff1d9070afb5c75ad0b944b35d3e8adea7ced0ec25ee886c40ee1c30867d681 SHA512 1e8950e9ed1bd550043aa99b5921c1bfa5e4ed022d462f5e1b94499fca1c9d511a6f22b364f2dc06c8e5e18616a1db43befb69a9ee8ceb9365f728e8a14ad70d
+EBUILD docker-18.06.1-r1.ebuild 8445 BLAKE2B bd0cf53757eb37bb0323736668699dd5478412c1d9d4316fbb8ad3c9c859bfa1ffd7b57528e957badef3730cbdcf0dafdc60339efa5b18693d5a5962f2089277 SHA512 ba45778d79fbc61564b9723221ae3d783d4f9be7db3c9b67373f9ef8dc3f9a12cd6aab4cd29a0d7ac4dc90eb001bee010cbee7d45906c80fa1bcd1b0a6294ece
EBUILD docker-18.06.1.ebuild 8445 BLAKE2B 8dcde1e55136e11a079aa564b1bbeb7fb7977fe138072c8f32dc9317934126095158518bafdc3ac3ee63d5f8298dc308c4688cc98a49bebb7e56ab7eee856f01 SHA512 5a02ab20202d7b78bda5a710e004f2de1c216f2982961167ebe77ad6edbd7f7cf1e3cdfc786dc51e82f31c88dbef71f0e06fbb7807e13ca87f1c1f298063b28f
EBUILD docker-9999.ebuild 8168 BLAKE2B d1111f0132aa330f95f8f9dcd5c49aee0c8a0eaa5ee3cbd567be89f0d2f4b8c230c80d817fe14272d7c2765f1877ad070ebe98107575ec0f43d10e2f6f6b089b SHA512 e629feee1e546a0ea4570692446697899199248334fc00337963eda8857fadde618fc42ad23288f4239cb7f6f71ad52a61a2d275e54a7694fd79fa1fc1610df3
MISC metadata.xml 1637 BLAKE2B 14c56a84e41ebd76827cf37c27fe21259ca06e00d8c7fe318bd5eca609a77a9e23fc5ea13caba1616e47d17978402f715e6a8bc40643ce0cfb3ee87494ee6858 SHA512 bdaea32036a7f65f7015634d45bdf4f13322f3266cda389b49d2c57ad86e9811731194af5786e312d5ea40dab8b8eb78fc7b79a2ffee186b8eaabae9cc3c7a1b
diff --git a/app-emulation/docker/docker-18.03.1-r1.ebuild b/app-emulation/docker/docker-18.03.1-r1.ebuild
new file mode 100644
index 000000000000..0af07da23fd9
--- /dev/null
+++ b/app-emulation/docker/docker-18.03.1-r1.ebuild
@@ -0,0 +1,303 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+EGO_PN="github.com/docker/docker-ce"
+
+if [[ ${PV} = *9999* ]]; then
+ # Docker cannot be fetched via "go get", thanks to autogenerated code
+ EGIT_REPO_URI="https://${EGO_PN}.git"
+ EGIT_CHECKOUT_DIR="${WORKDIR}/${P}/src/${EGO_PN}"
+ inherit git-r3
+else
+ inherit versionator
+ if [ "$(get_version_component_count)" = 4 ]; then
+ MY_PV="$(replace_version_separator 3 '-ce-')"
+ else
+ MY_PV="$PV-ce"
+ fi
+ DOCKER_GITCOMMIT="9ee9f40"
+ EGIT_COMMIT="v${MY_PV}"
+ SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm"
+ [ "$DOCKER_GITCOMMIT" ] || die "DOCKER_GITCOMMIT must be added manually for each bump!"
+ inherit golang-vcs-snapshot
+fi
+inherit bash-completion-r1 golang-base linux-info systemd udev user
+
+DESCRIPTION="The core functions you need to create Docker images and run Docker containers"
+HOMEPAGE="https://dockerproject.org"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="apparmor aufs btrfs +container-init +device-mapper hardened +overlay pkcs11 seccomp"
+
+# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
+CDEPEND="
+ >=dev-db/sqlite-3.7.9:3
+ device-mapper? (
+ >=sys-fs/lvm2-2.02.89[thin]
+ )
+ seccomp? ( >=sys-libs/libseccomp-2.2.1 )
+ apparmor? ( sys-libs/libapparmor )
+"
+
+DEPEND="
+ ${CDEPEND}
+
+ dev-go/go-md2man
+
+ btrfs? (
+ >=sys-fs/btrfs-progs-3.16.1
+ )
+"
+
+# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies
+# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#optional-dependencies
+RDEPEND="
+ ${CDEPEND}
+ >=net-firewall/iptables-1.4
+ sys-process/procps
+ >=dev-vcs/git-1.7
+ >=app-arch/xz-utils-4.9
+ dev-libs/libltdl
+ ~app-emulation/containerd-1.0.3
+ ~app-emulation/runc-1.0.0_rc5[apparmor?,seccomp?]
+ ~app-emulation/docker-proxy-0.8.0_p20180411
+ container-init? ( >=sys-process/tini-0.16.1[static] )
+"
+
+RESTRICT="installsources strip"
+
+S="${WORKDIR}/${P}/src/${EGO_PN}"
+
+PATCHES=( "${FILESDIR}"/bsc1073877-docker-apparmor-add-signal-r1.patch )
+
+# see "contrib/check-config.sh" from upstream's sources
+CONFIG_CHECK="
+ ~NAMESPACES ~NET_NS ~PID_NS ~IPC_NS ~UTS_NS
+ ~CGROUPS ~CGROUP_CPUACCT ~CGROUP_DEVICE ~CGROUP_FREEZER ~CGROUP_SCHED ~CPUSETS ~MEMCG
+ ~KEYS
+ ~VETH ~BRIDGE ~BRIDGE_NETFILTER
+ ~NF_NAT_IPV4 ~IP_NF_FILTER ~IP_NF_TARGET_MASQUERADE
+ ~NETFILTER_XT_MATCH_ADDRTYPE ~NETFILTER_XT_MATCH_CONNTRACK ~NETFILTER_XT_MATCH_IPVS
+ ~IP_NF_NAT ~NF_NAT ~NF_NAT_NEEDED
+ ~POSIX_MQUEUE
+
+ ~USER_NS
+ ~SECCOMP
+ ~CGROUP_PIDS
+ ~MEMCG_SWAP ~MEMCG_SWAP_ENABLED
+
+ ~BLK_CGROUP ~BLK_DEV_THROTTLING ~IOSCHED_CFQ ~CFQ_GROUP_IOSCHED
+ ~CGROUP_PERF
+ ~CGROUP_HUGETLB
+ ~NET_CLS_CGROUP
+ ~CFS_BANDWIDTH ~FAIR_GROUP_SCHED ~RT_GROUP_SCHED
+ ~IP_VS ~IP_VS_PROTO_TCP ~IP_VS_PROTO_UDP ~IP_VS_NFCT ~IP_VS_RR
+
+ ~VXLAN
+ ~CRYPTO ~CRYPTO_AEAD ~CRYPTO_GCM ~CRYPTO_SEQIV ~CRYPTO_GHASH ~XFRM_ALGO ~XFRM_USER
+ ~IPVLAN
+ ~MACVLAN ~DUMMY
+"
+
+ERROR_KEYS="CONFIG_KEYS: is mandatory"
+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_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_CFS_BANDWIDTH="CONFIG_CFS_BANDWIDTH: is optional for container statistics gathering"
+ERROR_XFRM_ALGO="CONFIG_XFRM_ALGO: is optional for secure networks"
+ERROR_XFRM_USER="CONFIG_XFRM_USER: is optional for secure networks"
+
+pkg_setup() {
+ if kernel_is lt 3 10; then
+ ewarn ""
+ ewarn "Using Docker with kernels older than 3.10 is unstable and unsupported."
+ ewarn " - http://docs.docker.com/engine/installation/binaries/#check-kernel-dependencies"
+ 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 kernel_is lt 4 5; then
+ CONFIG_CHECK+="
+ ~MEMCG_KMEM
+ "
+ ERROR_MEMCG_KMEM="CONFIG_MEMCG_KMEM: is optional"
+ fi
+
+ if kernel_is lt 4 7; then
+ CONFIG_CHECK+="
+ ~DEVPTS_MULTIPLE_INSTANCES
+ "
+ fi
+
+ if use aufs; then
+ CONFIG_CHECK+="
+ ~AUFS_FS
+ ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
+ "
+ ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs-sources are used instead of aufs4/aufs3"
+ fi
+
+ if use btrfs; then
+ CONFIG_CHECK+="
+ ~BTRFS_FS
+ ~BTRFS_FS_POSIX_ACL
+ "
+ fi
+
+ if use device-mapper; then
+ CONFIG_CHECK+="
+ ~BLK_DEV_DM ~DM_THIN_PROVISIONING ~EXT4_FS ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
+ "
+ fi
+
+ if use overlay; then
+ CONFIG_CHECK+="
+ ~OVERLAY_FS ~EXT4_FS_SECURITY ~EXT4_FS_POSIX_ACL
+ "
+ fi
+
+ linux-info_pkg_setup
+
+ # create docker group for the code checking for it in /etc/group
+ enewgroup docker
+}
+
+src_compile() {
+ export GOPATH="${WORKDIR}/${P}"
+
+ # setup CFLAGS and LDFLAGS for separate build target
+ # see https://github.com/tianon/docker-overlay/pull/10
+ export CGO_CFLAGS="-I${ROOT}/usr/include"
+ export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
+
+ # if we're building from a tarball, we need the GITCOMMIT value
+ [ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
+
+ # fake golang layout
+ ln -s docker-ce/components/engine ../docker || die
+ ln -s docker-ce/components/cli ../cli || die
+
+ # let's set up some optional features :)
+ export DOCKER_BUILDTAGS=''
+ for gd in aufs btrfs device-mapper overlay; do
+ if ! use $gd; then
+ DOCKER_BUILDTAGS+=" exclude_graphdriver_${gd//-/}"
+ fi
+ done
+
+ for tag in apparmor pkcs11 seccomp; do
+ if use $tag; then
+ DOCKER_BUILDTAGS+=" $tag"
+ fi
+ done
+
+ pushd components/engine || die
+
+ if use hardened; then
+ sed -i "s/EXTLDFLAGS_STATIC='/&-fno-PIC /" hack/make.sh || die
+ grep -q -- '-fno-PIC' hack/make.sh || die 'hardened sed failed'
+ sed "s/LDFLAGS_STATIC_DOCKER='/&-extldflags -fno-PIC /" \
+ -i hack/make/dynbinary-daemon || die
+ grep -q -- '-fno-PIC' hack/make/dynbinary-daemon || die 'hardened sed failed'
+ fi
+
+ # build daemon
+ VERSION="$(cat ../../VERSION)" \
+ ./hack/make.sh dynbinary || die 'dynbinary failed'
+
+ popd || die # components/engine
+
+ pushd components/cli || die
+
+ # build cli
+ emake \
+ LDFLAGS="$(usex hardened '-extldflags -fno-PIC' '')" \
+ VERSION="$(cat ../../VERSION)" \
+ GITCOMMIT="${DOCKER_GITCOMMIT}" \
+ DISABLE_WARN_OUTSIDE_CONTAINER=1 \
+ dynbinary || die
+
+ # build man pages
+ go build -o gen-manpages github.com/docker/cli/man || die
+ ./gen-manpages --root . --target ./man/man1 || die
+ ./man/md2man-all.sh -q || die
+ rm gen-manpages || die
+ # see "components/cli/scripts/docs/generate-man.sh" (which also does "go get" for go-md2man)
+
+ popd || die # components/cli
+}
+
+src_install() {
+ dosym containerd /usr/bin/docker-containerd
+ dosym containerd-shim /usr/bin/docker-containerd-shim
+ dosym runc /usr/bin/docker-runc
+ use container-init && dosym tini /usr/bin/docker-init
+
+ pushd components/engine || die
+ newbin "$(readlink -f bundles/latest/dynbinary-daemon/dockerd)" dockerd
+
+ newinitd contrib/init/openrc/docker.initd docker
+ newconfd contrib/init/openrc/docker.confd docker
+
+ systemd_dounit contrib/init/systemd/docker.{service,socket}
+
+ udev_dorules contrib/udev/*.rules
+
+ dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
+ dodoc -r docs/*
+
+ insinto /usr/share/vim/vimfiles
+ doins -r contrib/syntax/vim/ftdetect
+ doins -r contrib/syntax/vim/syntax
+
+ # note: intentionally not using "doins" so that we preserve +x bits
+ dodir /usr/share/${PN}/contrib
+ cp -R contrib/* "${ED}/usr/share/${PN}/contrib"
+ popd || die # components/engine
+
+ pushd components/cli || die
+
+ newbin build/docker-* docker
+
+ doman man/man*/*
+
+ dobashcomp contrib/completion/bash/*
+ insinto /usr/share/zsh/site-functions
+ doins contrib/completion/zsh/_*
+ popd || die # components/cli
+}
+
+pkg_postinst() {
+ udev_reload
+
+ elog
+ 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 " rc-update add docker default"
+ elog "Similarly for systemd:"
+ elog " systemctl enable docker.service"
+ elog
+ elog "To use Docker as a non-root user, add yourself to the 'docker' group:"
+ elog " usermod -aG docker youruser"
+ elog
+}
diff --git a/app-emulation/docker/docker-18.06.1-r1.ebuild b/app-emulation/docker/docker-18.06.1-r1.ebuild
new file mode 100644
index 000000000000..149bfeb91e81
--- /dev/null
+++ b/app-emulation/docker/docker-18.06.1-r1.ebuild
@@ -0,0 +1,305 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+EGO_PN="github.com/docker/docker-ce"
+
+if [[ ${PV} = *9999* ]]; then
+ # Docker cannot be fetched via "go get", thanks to autogenerated code
+ EGIT_REPO_URI="https://${EGO_PN}.git"
+ EGIT_CHECKOUT_DIR="${WORKDIR}/${P}/src/${EGO_PN}"
+ inherit git-r3
+else
+ inherit versionator
+ if [ "$(get_version_component_count)" = 4 ]; then
+ MY_PV="$(replace_version_separator 3 '-ce-')"
+ else
+ MY_PV="$PV-ce"
+ fi
+ DOCKER_GITCOMMIT="e68fc7a"
+ EGIT_COMMIT="v${MY_PV}"
+ SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~arm64"
+ [ "$DOCKER_GITCOMMIT" ] || die "DOCKER_GITCOMMIT must be added manually for each bump!"
+ inherit golang-vcs-snapshot
+fi
+inherit bash-completion-r1 golang-base linux-info systemd udev user
+
+DESCRIPTION="The core functions you need to create Docker images and run Docker containers"
+HOMEPAGE="https://dockerproject.org"
+LICENSE="Apache-2.0"
+SLOT="0"
+IUSE="apparmor aufs btrfs +container-init +device-mapper hardened +overlay pkcs11 seccomp"
+
+# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
+CDEPEND="
+ >=dev-db/sqlite-3.7.9:3
+ device-mapper? (
+ >=sys-fs/lvm2-2.02.89[thin]
+ )
+ seccomp? ( >=sys-libs/libseccomp-2.2.1 )
+ apparmor? ( sys-libs/libapparmor )
+"
+
+DEPEND="
+ ${CDEPEND}
+
+ dev-go/go-md2man
+
+ btrfs? (
+ >=sys-fs/btrfs-progs-3.16.1
+ )
+"
+
+# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies
+# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#optional-dependencies
+RDEPEND="
+ ${CDEPEND}
+ >=net-firewall/iptables-1.4
+ sys-process/procps
+ >=dev-vcs/git-1.7
+ >=app-arch/xz-utils-4.9
+ dev-libs/libltdl
+ ~app-emulation/containerd-1.1.2
+ ~app-emulation/runc-1.0.0_rc5_p20180509[apparmor?,seccomp?]
+ ~app-emulation/docker-proxy-0.8.0_p20180626
+ container-init? ( >=sys-process/tini-0.18.0[static] )
+"
+
+RESTRICT="installsources strip"
+
+S="${WORKDIR}/${P}/src/${EGO_PN}"
+
+PATCHES=( "${FILESDIR}"/bsc1073877-docker-apparmor-add-signal-r2.patch )
+
+# see "contrib/check-config.sh" from upstream's sources
+CONFIG_CHECK="
+ ~NAMESPACES ~NET_NS ~PID_NS ~IPC_NS ~UTS_NS
+ ~CGROUPS ~CGROUP_CPUACCT ~CGROUP_DEVICE ~CGROUP_FREEZER ~CGROUP_SCHED ~CPUSETS ~MEMCG
+ ~KEYS
+ ~VETH ~BRIDGE ~BRIDGE_NETFILTER
+ ~NF_NAT_IPV4 ~IP_NF_FILTER ~IP_NF_TARGET_MASQUERADE
+ ~NETFILTER_XT_MATCH_ADDRTYPE ~NETFILTER_XT_MATCH_CONNTRACK ~NETFILTER_XT_MATCH_IPVS
+ ~IP_NF_NAT ~NF_NAT ~NF_NAT_NEEDED
+ ~POSIX_MQUEUE
+
+ ~USER_NS
+ ~SECCOMP
+ ~CGROUP_PIDS
+ ~MEMCG_SWAP ~MEMCG_SWAP_ENABLED
+
+ ~BLK_CGROUP ~BLK_DEV_THROTTLING ~IOSCHED_CFQ ~CFQ_GROUP_IOSCHED
+ ~CGROUP_PERF
+ ~CGROUP_HUGETLB
+ ~NET_CLS_CGROUP
+ ~CFS_BANDWIDTH ~FAIR_GROUP_SCHED ~RT_GROUP_SCHED
+ ~IP_VS ~IP_VS_PROTO_TCP ~IP_VS_PROTO_UDP ~IP_VS_NFCT ~IP_VS_RR
+
+ ~VXLAN
+ ~CRYPTO ~CRYPTO_AEAD ~CRYPTO_GCM ~CRYPTO_SEQIV ~CRYPTO_GHASH ~XFRM_ALGO ~XFRM_USER
+ ~IPVLAN
+ ~MACVLAN ~DUMMY
+"
+
+ERROR_KEYS="CONFIG_KEYS: is mandatory"
+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_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_CFS_BANDWIDTH="CONFIG_CFS_BANDWIDTH: is optional for container statistics gathering"
+ERROR_XFRM_ALGO="CONFIG_XFRM_ALGO: is optional for secure networks"
+ERROR_XFRM_USER="CONFIG_XFRM_USER: is optional for secure networks"
+
+pkg_setup() {
+ if kernel_is lt 3 10; then
+ ewarn ""
+ ewarn "Using Docker with kernels older than 3.10 is unstable and unsupported."
+ ewarn " - http://docs.docker.com/engine/installation/binaries/#check-kernel-dependencies"
+ 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 kernel_is lt 4 5; then
+ CONFIG_CHECK+="
+ ~MEMCG_KMEM
+ "
+ ERROR_MEMCG_KMEM="CONFIG_MEMCG_KMEM: is optional"
+ fi
+
+ if kernel_is lt 4 7; then
+ CONFIG_CHECK+="
+ ~DEVPTS_MULTIPLE_INSTANCES
+ "
+ fi
+
+ if use aufs; then
+ CONFIG_CHECK+="
+ ~AUFS_FS
+ ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
+ "
+ ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs-sources are used instead of aufs4/aufs3"
+ fi
+
+ if use btrfs; then
+ CONFIG_CHECK+="
+ ~BTRFS_FS
+ ~BTRFS_FS_POSIX_ACL
+ "
+ fi
+
+ if use device-mapper; then
+ CONFIG_CHECK+="
+ ~BLK_DEV_DM ~DM_THIN_PROVISIONING ~EXT4_FS ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
+ "
+ fi
+
+ if use overlay; then
+ CONFIG_CHECK+="
+ ~OVERLAY_FS ~EXT4_FS_SECURITY ~EXT4_FS_POSIX_ACL
+ "
+ fi
+
+ linux-info_pkg_setup
+
+ # create docker group for the code checking for it in /etc/group
+ enewgroup docker
+}
+
+src_compile() {
+ export GOPATH="${WORKDIR}/${P}"
+
+ # setup CFLAGS and LDFLAGS for separate build target
+ # see https://github.com/tianon/docker-overlay/pull/10
+ export CGO_CFLAGS="-I${ROOT}/usr/include"
+ export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
+
+ # if we're building from a tarball, we need the GITCOMMIT value
+ [ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
+
+ # fake golang layout
+ ln -s docker-ce/components/engine ../docker || die
+ ln -s docker-ce/components/cli ../cli || die
+
+ # let's set up some optional features :)
+ export DOCKER_BUILDTAGS=''
+ for gd in aufs btrfs device-mapper overlay; do
+ if ! use $gd; then
+ DOCKER_BUILDTAGS+=" exclude_graphdriver_${gd//-/}"
+ fi
+ done
+
+ for tag in apparmor pkcs11 seccomp; do
+ if use $tag; then
+ DOCKER_BUILDTAGS+=" $tag"
+ fi
+ done
+
+ pushd components/engine || die
+
+ if use hardened; then
+ sed -i "s/EXTLDFLAGS_STATIC='/&-fno-PIC /" hack/make.sh || die
+ grep -q -- '-fno-PIC' hack/make.sh || die 'hardened sed failed'
+ sed "s/LDFLAGS_STATIC_DOCKER='/&-extldflags -fno-PIC /" \
+ -i hack/make/dynbinary-daemon || die
+ grep -q -- '-fno-PIC' hack/make/dynbinary-daemon || die 'hardened sed failed'
+ fi
+
+ # build daemon
+ VERSION="$(cat ../../VERSION)" \
+ ./hack/make.sh dynbinary || die 'dynbinary failed'
+
+ popd || die # components/engine
+
+ pushd components/cli || die
+
+ # build cli
+ emake \
+ LDFLAGS="$(usex hardened '-extldflags -fno-PIC' '')" \
+ VERSION="$(cat ../../VERSION)" \
+ GITCOMMIT="${DOCKER_GITCOMMIT}" \
+ DISABLE_WARN_OUTSIDE_CONTAINER=1 \
+ dynbinary || die
+
+ # build man pages
+ go build -o gen-manpages github.com/docker/cli/man || die
+ ./gen-manpages --root . --target ./man/man1 || die
+ ./man/md2man-all.sh -q || die
+ rm gen-manpages || die
+ # see "components/cli/scripts/docs/generate-man.sh" (which also does "go get" for go-md2man)
+
+ popd || die # components/cli
+}
+
+src_install() {
+ dosym containerd /usr/bin/docker-containerd
+ dosym containerd-shim /usr/bin/docker-containerd-shim
+ dosym runc /usr/bin/docker-runc
+ use container-init && dosym tini /usr/bin/docker-init
+
+ pushd components/engine || die
+ newbin "$(readlink -f bundles/latest/dynbinary-daemon/dockerd)" dockerd
+
+ newinitd contrib/init/openrc/docker.initd docker
+ newconfd contrib/init/openrc/docker.confd docker
+
+ systemd_dounit contrib/init/systemd/docker.{service,socket}
+
+ udev_dorules contrib/udev/*.rules
+
+ dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
+ dodoc -r docs/*
+
+ insinto /usr/share/vim/vimfiles
+ doins -r contrib/syntax/vim/ftdetect
+ doins -r contrib/syntax/vim/syntax
+
+ # note: intentionally not using "doins" so that we preserve +x bits
+ dodir /usr/share/${PN}/contrib
+ cp -R contrib/* "${ED}/usr/share/${PN}/contrib"
+ popd || die # components/engine
+
+ pushd components/cli || die
+
+ newbin build/docker-* docker
+
+ doman man/man*/*
+
+ dobashcomp contrib/completion/bash/*
+ insinto /usr/share/fish/vendor_completions.d/
+ doins contrib/completion/fish/docker.fish
+ insinto /usr/share/zsh/site-functions
+ doins contrib/completion/zsh/_*
+ popd || die # components/cli
+}
+
+pkg_postinst() {
+ udev_reload
+
+ elog
+ 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 " rc-update add docker default"
+ elog "Similarly for systemd:"
+ elog " systemctl enable docker.service"
+ elog
+ elog "To use Docker as a non-root user, add yourself to the 'docker' group:"
+ elog " usermod -aG docker youruser"
+ elog
+}
diff --git a/app-emulation/docker/files/bsc1073877-docker-apparmor-add-signal-r2.patch b/app-emulation/docker/files/bsc1073877-docker-apparmor-add-signal-r2.patch
new file mode 100644
index 000000000000..fd365425fb95
--- /dev/null
+++ b/app-emulation/docker/files/bsc1073877-docker-apparmor-add-signal-r2.patch
@@ -0,0 +1,72 @@
+From 4822fb1e2423d88cdf0ad5d039b8fd3274b05401 Mon Sep 17 00:00:00 2001
+From: Aleksa Sarai <asarai@suse.de>
+Date: Sun, 8 Apr 2018 20:21:30 +1000
+Subject: [PATCH] apparmor: allow receiving of signals from 'docker kill'
+
+In newer kernels, AppArmor will reject attempts to send signals to a
+container because the signal originated from outside of that AppArmor
+profile. Correct this by allowing all unconfined signals to be received.
+
+Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
+Signed-off-by: Aleksa Sarai <asarai@suse.de>
+---
+ profiles/apparmor/apparmor.go | 21 +++++++++++++++++++++
+ profiles/apparmor/template.go | 6 ++++++
+ 2 files changed, 27 insertions(+)
+
+diff --git a/components/engine/profiles/apparmor/apparmor.go b/components/engine/profiles/apparmor/apparmor.go
+index b021668c8e4c..2f58ee852cab 100644
+--- a/components/engine/profiles/apparmor/apparmor.go
++++ b/components/engine/profiles/apparmor/apparmor.go
+@@ -23,6 +23,8 @@ var (
+ type profileData struct {
+ // Name is profile name.
+ Name string
++ // DaemonProfile is the profile name of our daemon.
++ DaemonProfile string
+ // Imports defines the apparmor functions to import, before defining the profile.
+ Imports []string
+ // InnerImports defines the apparmor functions to import in the profile.
+@@ -70,6 +72,25 @@ func InstallDefault(name string) error {
+ Name: name,
+ }
+
++ // Figure out the daemon profile.
++ currentProfile, err := ioutil.ReadFile("/proc/self/attr/current")
++ if err != nil {
++ // If we couldn't get the daemon profile, assume we are running
++ // unconfined which is generally the default.
++ currentProfile = nil
++ }
++ daemonProfile := string(currentProfile)
++ // Normally profiles are suffixed by " (enforcing)" or similar. AppArmor
++ // profiles cannot contain spaces so this doesn't restrict daemon profile
++ // names.
++ if parts := strings.SplitN(daemonProfile, " ", 2); len(parts) >= 1 {
++ daemonProfile = parts[0]
++ }
++ if daemonProfile == "" {
++ daemonProfile = "unconfined"
++ }
++ p.DaemonProfile = daemonProfile
++
+ // Install to a temporary directory.
+ f, err := ioutil.TempFile("", name)
+ if err != nil {
+diff --git a/components/engine/profiles/apparmor/template.go b/components/engine/profiles/apparmor/template.go
+index c00a3f70e993..400b3bd50a11 100644
+--- a/components/engine/profiles/apparmor/template.go
++++ b/components/engine/profiles/apparmor/template.go
+@@ -17,6 +17,12 @@ profile {{.Name}} flags=(attach_disconnected,mediate_deleted) {
+ capability,
+ file,
+ umount,
++{{if ge .Version 208096}}
++{{/* Allow 'docker kill' to actually send signals to container processes. */}}
++ signal (receive) peer={{.DaemonProfile}},
++{{/* Allow container processes to send signals amongst themselves. */}}
++ signal (send,receive) peer={{.Name}},
++{{end}}
+
+ deny @{PROC}/* w, # deny write for all files directly in /proc (not in a subdir)
+ # deny write to files not in /proc/<number>/** or /proc/sys/**