Gentoo Archives: gentoo-commits

From: "Manuel Rüger" <mrueg@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/docker/
Date: Thu, 09 Feb 2017 14:16:30
Message-Id: 1486649742.a94b5f7f167bb8ad35eb7f2a12e2109c89ce92b9.mrueg@gentoo
1 commit: a94b5f7f167bb8ad35eb7f2a12e2109c89ce92b9
2 Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
3 AuthorDate: Thu Feb 9 14:15:42 2017 +0000
4 Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 9 14:15:42 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a94b5f7f
7
8 app-emulation/docker: Version bump to 1.13.1
9
10 Package-Manager: portage-2.3.3
11
12 app-emulation/docker/Manifest | 1 +
13 app-emulation/docker/docker-1.13.1.ebuild | 287 ++++++++++++++++++++++++++++++
14 2 files changed, 288 insertions(+)
15
16 diff --git a/app-emulation/docker/Manifest b/app-emulation/docker/Manifest
17 index f54cf9cfae..6094cd8c5d 100644
18 --- a/app-emulation/docker/Manifest
19 +++ b/app-emulation/docker/Manifest
20 @@ -1,2 +1,3 @@
21 DIST docker-1.12.6.tar.gz 13694205 SHA256 0413f3513c2a6842ed9cf837154c8a722e9b34cb36b33430348489baa183707e SHA512 98e0fa0ec0dad4d392188b0d2cf42b2b564403463c369e1fe060f1abc2e97d97375a88587080671ef905e6a34b991d83265f43c3112575af019cf85eef0c2c25 WHIRLPOOL 55d10e4c4ab960320094637a847768ad85dc1fccaa6cc77ea0ca82f2d23b27e92e2f2c0cbc03f53676012c95883f65c6fa16d26970138fa129d37bf278fc8c0b
22 DIST docker-1.13.0.tar.gz 7746065 SHA256 845cc9a7a48ed1cc60f062882285358a1c2a845b74c5d1d859606a28e4a47d3e SHA512 c5531f0c4bfeb541a4bf9b324830afaa27edb99f34990bdfa588843baa169edb1c2d545452ee8074a1ac322e7788952eb369db884c015e29763247e1e023172c WHIRLPOOL 87fcadde4ef2c15d432b38e06c4ed4d6df03bb6ecddd24e489712020c2be3932da2f9ff47c2fc78dd0b56dacb94b89dc58a2d1c7d8995e1e5b834acd28a33011
23 +DIST docker-1.13.1.tar.gz 7788075 SHA256 2730e7cc15492de8f1d6f9510c64620fc9004c8afc1410bf3ebac9fc3f9f83c6 SHA512 e480a884d7bb4f41f5c036afd5fae878e03aa740297dd3dd4df0eb8766efa6426ba636453513b423666eea21ba99f162ec27885828f8348d8746424944a3cfb4 WHIRLPOOL 8c0bfadf4102f6f41c182d8443276aa68ca1242d8321ce8fda639f0ad2162ae62d7310dbbb0967269d466207e54131b0a829bf6365f87fceb7114bbc1832dcfe
24
25 diff --git a/app-emulation/docker/docker-1.13.1.ebuild b/app-emulation/docker/docker-1.13.1.ebuild
26 new file mode 100644
27 index 0000000000..5a63ad0d40
28 --- /dev/null
29 +++ b/app-emulation/docker/docker-1.13.1.ebuild
30 @@ -0,0 +1,287 @@
31 +# Copyright 1999-2017 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +# $Id$
34 +
35 +EAPI=6
36 +
37 +EGO_PN="github.com/docker/docker"
38 +
39 +if [[ ${PV} = *9999* ]]; then
40 + # Docker cannot be fetched via "go get", thanks to autogenerated code
41 + EGIT_REPO_URI="https://${EGO_PN}.git"
42 + EGIT_CHECKOUT_DIR="${WORKDIR}/${P}/src/${EGO_PN}"
43 + inherit git-r3
44 +else
45 + MY_PV="${PV/_/-}"
46 + DOCKER_GITCOMMIT="092cba3"
47 + EGIT_COMMIT="v${MY_PV}"
48 + SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
49 + KEYWORDS="~amd64"
50 + [ "$DOCKER_GITCOMMIT" ] || die "DOCKER_GITCOMMIT must be added manually for each bump!"
51 + inherit golang-vcs-snapshot
52 +fi
53 +inherit bash-completion-r1 golang-base linux-info systemd udev user
54 +
55 +DESCRIPTION="The core functions you need to create Docker images and run Docker containers"
56 +HOMEPAGE="https://dockerproject.org"
57 +LICENSE="Apache-2.0"
58 +SLOT="0"
59 +IUSE="apparmor aufs btrfs +container-init +device-mapper hardened overlay pkcs11 seccomp"
60 +
61 +# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
62 +CDEPEND="
63 + >=dev-db/sqlite-3.7.9:3
64 + device-mapper? (
65 + >=sys-fs/lvm2-2.02.89[thin]
66 + )
67 + seccomp? ( >=sys-libs/libseccomp-2.2.1 )
68 + apparmor? ( sys-libs/libapparmor )
69 +"
70 +
71 +DEPEND="
72 + ${CDEPEND}
73 +
74 + dev-go/go-md2man
75 +
76 + btrfs? (
77 + >=sys-fs/btrfs-progs-3.16.1
78 + )
79 +"
80 +
81 +# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies
82 +# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#optional-dependencies
83 +RDEPEND="
84 + ${CDEPEND}
85 +
86 + !app-emulation/docker-bin
87 + >=net-firewall/iptables-1.4
88 + sys-process/procps
89 + >=dev-vcs/git-1.7
90 + >=app-arch/xz-utils-4.9
91 +
92 + >=app-emulation/containerd-0.2.5
93 + app-emulation/runc[apparmor?,seccomp?]
94 + app-emulation/docker-proxy
95 + container-init? ( >=sys-process/tini-0.13.0[static] )
96 +"
97 +
98 +RESTRICT="installsources strip"
99 +
100 +S="${WORKDIR}/${P}/src/${EGO_PN}"
101 +
102 +# see "contrib/check-config.sh" from upstream's sources
103 +CONFIG_CHECK="
104 + ~NAMESPACES ~NET_NS ~PID_NS ~IPC_NS ~UTS_NS
105 + ~CGROUPS ~CGROUP_CPUACCT ~CGROUP_DEVICE ~CGROUP_FREEZER ~CGROUP_SCHED ~CPUSETS ~MEMCG
106 + ~KEYS
107 + ~VETH ~BRIDGE ~BRIDGE_NETFILTER
108 + ~NF_NAT_IPV4 ~IP_NF_FILTER ~IP_NF_TARGET_MASQUERADE
109 + ~NETFILTER_XT_MATCH_ADDRTYPE ~NETFILTER_XT_MATCH_CONNTRACK
110 + ~NF_NAT ~NF_NAT_NEEDED
111 + ~POSIX_MQUEUE
112 +
113 + ~USER_NS
114 + ~SECCOMP
115 + ~CGROUP_PIDS
116 + ~MEMCG_SWAP ~MEMCG_SWAP_ENABLED
117 +
118 + ~BLK_CGROUP ~BLK_DEV_THROTTLING ~IOSCHED_CFQ ~CFQ_GROUP_IOSCHED
119 + ~CGROUP_PERF
120 + ~CGROUP_HUGETLB
121 + ~NET_CLS_CGROUP
122 + ~CFS_BANDWIDTH ~FAIR_GROUP_SCHED ~RT_GROUP_SCHED
123 + ~IP_VS ~IP_VS_PROTO_TCP ~IP_VS_PROTO_UDP ~IP_VS_NFCT
124 +
125 + ~VXLAN
126 + ~XFRM_ALGO ~XFRM_USER
127 + ~IPVLAN
128 + ~MACVLAN ~DUMMY
129 +"
130 +
131 +ERROR_KEYS="CONFIG_KEYS: is mandatory"
132 +ERROR_MEMCG_SWAP="CONFIG_MEMCG_SWAP: is required if you wish to limit swap usage of containers"
133 +ERROR_RESOURCE_COUNTERS="CONFIG_RESOURCE_COUNTERS: is optional for container statistics gathering"
134 +
135 +ERROR_BLK_CGROUP="CONFIG_BLK_CGROUP: is optional for container statistics gathering"
136 +ERROR_IOSCHED_CFQ="CONFIG_IOSCHED_CFQ: is optional for container statistics gathering"
137 +ERROR_CGROUP_PERF="CONFIG_CGROUP_PERF: is optional for container statistics gathering"
138 +ERROR_CFS_BANDWIDTH="CONFIG_CFS_BANDWIDTH: is optional for container statistics gathering"
139 +ERROR_XFRM_ALGO="CONFIG_XFRM_ALGO: is optional for secure networks"
140 +ERROR_XFRM_USER="CONFIG_XFRM_USER: is optional for secure networks"
141 +
142 +pkg_setup() {
143 + if kernel_is lt 3 10; then
144 + ewarn ""
145 + ewarn "Using Docker with kernels older than 3.10 is unstable and unsupported."
146 + ewarn " - http://docs.docker.com/engine/installation/binaries/#check-kernel-dependencies"
147 + fi
148 +
149 + # for where these kernel versions come from, see:
150 + # https://www.google.com/search?q=945b2b2d259d1a4364a2799e80e8ff32f8c6ee6f+site%3Akernel.org%2Fpub%2Flinux%2Fkernel+file%3AChangeLog*
151 + if ! {
152 + kernel_is ge 3 16 \
153 + || { kernel_is 3 15 && kernel_is ge 3 15 5; } \
154 + || { kernel_is 3 14 && kernel_is ge 3 14 12; } \
155 + || { kernel_is 3 12 && kernel_is ge 3 12 25; }
156 + }; then
157 + ewarn ""
158 + ewarn "There is a serious Docker-related kernel panic that has been fixed in 3.16+"
159 + ewarn " (and was backported to 3.15.5+, 3.14.12+, and 3.12.25+)"
160 + ewarn ""
161 + ewarn "See also https://github.com/docker/docker/issues/2960"
162 + fi
163 +
164 + if kernel_is le 3 18; then
165 + CONFIG_CHECK+="
166 + ~RESOURCE_COUNTERS
167 + "
168 + fi
169 +
170 + if kernel_is le 3 13; then
171 + CONFIG_CHECK+="
172 + ~NETPRIO_CGROUP
173 + "
174 + else
175 + CONFIG_CHECK+="
176 + ~CGROUP_NET_PRIO
177 + "
178 + fi
179 +
180 + if kernel_is lt 4 5; then
181 + CONFIG_CHECK+="
182 + ~MEMCG_KMEM
183 + "
184 + ERROR_MEMCG_KMEM="CONFIG_MEMCG_KMEM: is optional"
185 + fi
186 +
187 + if kernel_is lt 4 7; then
188 + CONFIG_CHECK+="
189 + ~DEVPTS_MULTIPLE_INSTANCES
190 + "
191 + fi
192 +
193 + if use aufs; then
194 + CONFIG_CHECK+="
195 + ~AUFS_FS
196 + ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
197 + "
198 + ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs-sources are used instead of aufs4/aufs3"
199 + fi
200 +
201 + if use btrfs; then
202 + CONFIG_CHECK+="
203 + ~BTRFS_FS
204 + ~BTRFS_FS_POSIX_ACL
205 + "
206 + fi
207 +
208 + if use device-mapper; then
209 + CONFIG_CHECK+="
210 + ~BLK_DEV_DM ~DM_THIN_PROVISIONING ~EXT4_FS ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
211 + "
212 + fi
213 +
214 + if use overlay; then
215 + CONFIG_CHECK+="
216 + ~OVERLAY_FS ~EXT4_FS_SECURITY ~EXT4_FS_POSIX_ACL
217 + "
218 + fi
219 +
220 + linux-info_pkg_setup
221 +
222 + # create docker group for the code checking for it in /etc/group
223 + enewgroup docker
224 +}
225 +
226 +src_compile() {
227 + export GOPATH="${WORKDIR}/${P}:${PWD}/vendor"
228 +
229 + # setup CFLAGS and LDFLAGS for separate build target
230 + # see https://github.com/tianon/docker-overlay/pull/10
231 + export CGO_CFLAGS="-I${ROOT}/usr/include"
232 + export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
233 +
234 + # if we're building from a tarball, we need the GITCOMMIT value
235 + [ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
236 +
237 + if use hardened; then
238 + sed -i "s/EXTLDFLAGS_STATIC='/&-fno-PIC /" hack/make.sh || die
239 + grep -q -- '-fno-PIC' hack/make.sh || die 'hardened sed failed'
240 +
241 + sed "s/LDFLAGS_STATIC_DOCKER='/&-extldflags -fno-PIC /" \
242 + -i hack/make/dynbinary-client || die
243 + sed "s/LDFLAGS_STATIC_DOCKER='/&-extldflags -fno-PIC /" \
244 + -i hack/make/dynbinary-daemon || die
245 + grep -q -- '-fno-PIC' hack/make/dynbinary-daemon || die 'hardened sed failed'
246 + grep -q -- '-fno-PIC' hack/make/dynbinary-client || die 'hardened sed failed'
247 + fi
248 +
249 + # let's set up some optional features :)
250 + export DOCKER_BUILDTAGS=''
251 + for gd in aufs btrfs device-mapper overlay; do
252 + if ! use $gd; then
253 + DOCKER_BUILDTAGS+=" exclude_graphdriver_${gd//-/}"
254 + fi
255 + done
256 +
257 + for tag in apparmor pkcs11 seccomp; do
258 + if use $tag; then
259 + DOCKER_BUILDTAGS+=" $tag"
260 + fi
261 + done
262 +
263 + # time to build!
264 + ./hack/make.sh dynbinary || die 'dynbinary failed'
265 +
266 + # build the man pages too
267 + ./man/md2man-all.sh || die "unable to generate man pages"
268 +}
269 +
270 +src_install() {
271 + VERSION="$(cat VERSION)"
272 + newbin "bundles/$VERSION/dynbinary-client/docker-$VERSION" docker
273 + newbin "bundles/$VERSION/dynbinary-daemon/dockerd-$VERSION" dockerd
274 + dosym containerd /usr/bin/docker-containerd
275 + dosym containerd-shim /usr/bin/docker-containerd-shim
276 + dosym runc /usr/bin/docker-runc
277 + use container-init && dosym tini /usr/bin/docker-init
278 +
279 + newinitd contrib/init/openrc/docker.initd docker
280 + newconfd contrib/init/openrc/docker.confd docker
281 +
282 + systemd_dounit contrib/init/systemd/docker.{service,socket}
283 +
284 + udev_dorules contrib/udev/*.rules
285 +
286 + dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
287 + dodoc -r docs/*
288 + doman man/man*/*
289 +
290 + dobashcomp contrib/completion/bash/*
291 +
292 + insinto /usr/share/zsh/site-functions
293 + doins contrib/completion/zsh/_*
294 +
295 + insinto /usr/share/vim/vimfiles
296 + doins -r contrib/syntax/vim/ftdetect
297 + doins -r contrib/syntax/vim/syntax
298 +
299 + # note: intentionally not using "doins" so that we preserve +x bits
300 + dodir /usr/share/${PN}/contrib
301 + cp -R contrib/* "${ED}/usr/share/${PN}/contrib"
302 +}
303 +
304 +pkg_postinst() {
305 + udev_reload
306 +
307 + elog
308 + elog "To use Docker, the Docker daemon must be running as root. To automatically"
309 + elog "start the Docker daemon at boot, add Docker to the default runlevel:"
310 + elog " rc-update add docker default"
311 + elog "Similarly for systemd:"
312 + elog " systemctl enable docker.service"
313 + elog
314 + elog "To use Docker as a non-root user, add yourself to the 'docker' group:"
315 + elog " usermod -aG docker youruser"
316 + elog
317 +}