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