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: Tue, 02 Jan 2018 13:01:04
Message-Id: 1514898044.443495592b402e2c9946177e02466cef94cae8fe.mrueg@gentoo
1 commit: 443495592b402e2c9946177e02466cef94cae8fe
2 Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 2 13:00:44 2018 +0000
4 Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
5 CommitDate: Tue Jan 2 13:00:44 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=44349559
7
8 app-emulation/docker: Version bump to 17.12.0
9
10 Package-Manager: Portage-2.3.19, Repoman-2.3.6
11
12 app-emulation/docker/Manifest | 1 +
13 app-emulation/docker/docker-17.12.0.ebuild | 315 +++++++++++++++++++++++++++++
14 2 files changed, 316 insertions(+)
15
16 diff --git a/app-emulation/docker/Manifest b/app-emulation/docker/Manifest
17 index 7713521b1c9..b77a068200d 100644
18 --- a/app-emulation/docker/Manifest
19 +++ b/app-emulation/docker/Manifest
20 @@ -2,3 +2,4 @@ DIST docker-17.06.2.tar.gz 9684548 BLAKE2B bfe36c5fbc98bb2b1e8534cb59b54aef9b371
21 DIST docker-17.09.0.tar.gz 10132253 BLAKE2B 2964f20fd0badbea7961ccc4026fa107edbb42e92a63bfba18aed456c474990d76d118baec423c6d3cb6a89215a802b822b245222b73552569f03f0f30684819 SHA512 d96570825fb3dc24516b3b9666e935d5277674221452d8a23e6bcd1116f0bb3a2b8b315f47b98f52e681ab79309c099bb3b5c437af942539708ff3126c993638
22 DIST docker-17.09.1.tar.gz 10135978 BLAKE2B 4c2dea48b3593332ac7b02bfcc7bf037b858adf87e5dd8ff84b03aca75d711375fafb06683a6a57cd2549c1a0a0edb2d7c7c1d4cf1b9ceefce18f4f91164b931 SHA512 e968ced32c379b74602053d1e9fe9ee5abe595078bb8d5f0d994c7eafd1557158d58fa48489ca8d7d578dbc7a5241182288b3ab37885b53abb8364d7aa9d2a4f
23 DIST docker-17.11.0.tar.gz 10649392 BLAKE2B fff44885f535020bfd8cd6ab9c347df12610779de90290330e1315a2570c1e85a8d0c497320528f44187389b61c3f177f8032c3edc236347900034dfe3eaf764 SHA512 b9444775fd7bca1e1ec5b2fdeba063f7a7ead4a5b1fd60c836f42f98a8fe9a3a2fe963332e225491280772c9e4024fec5ebfa9b89ab9fa1b83cd60b5afd0333e
24 +DIST docker-17.12.0.tar.gz 11011208 BLAKE2B aee4a1b8af69b2418c62b0f5fc8cf6b1a0945ccbc870572e5835ec23bd9b6d5919fe9e8170b9d3c20eea479fec05aa97f380e1229b09cccbdbca9ed2baaa9f0b SHA512 1a4dfc86dc6c85c78d2abf4f559e5efe0fb22d915997f047fa6641e2aefb3e2fc6cb0124b6a0fc69abfc09ac8b261ebbd4d80b380cf9eb4304d3e1a423957b67
25
26 diff --git a/app-emulation/docker/docker-17.12.0.ebuild b/app-emulation/docker/docker-17.12.0.ebuild
27 new file mode 100644
28 index 00000000000..0a2445ceb54
29 --- /dev/null
30 +++ b/app-emulation/docker/docker-17.12.0.ebuild
31 @@ -0,0 +1,315 @@
32 +# Copyright 1999-2018 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="1caf76c"
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 + dev-libs/libltdl
95 + ~app-emulation/containerd-1.0.0
96 + ~app-emulation/docker-runc-1.0.0_rc4_p20171108[apparmor?,seccomp?]
97 + >=app-emulation/docker-proxy-0.8.0_p20170917
98 + container-init? ( >=sys-process/tini-0.16.1[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 + DISABLE_WARN_OUTSIDE_CONTAINER=1 \
281 + dynbinary || die
282 +
283 + # build man pages
284 + go build -o gen-manpages github.com/docker/cli/man || die
285 + ./gen-manpages --root . --target ./man/man1 || die
286 + ./man/md2man-all.sh -q || die
287 + rm gen-manpages || die
288 + # see "components/cli/scripts/docs/generate-man.sh" (which also does "go get" for go-md2man)
289 +
290 + popd || die # components/cli
291 +}
292 +
293 +src_install() {
294 + dosym containerd /usr/bin/docker-containerd
295 + dosym containerd-shim /usr/bin/docker-containerd-shim
296 + dosym runc /usr/bin/docker-runc
297 + use container-init && dosym tini /usr/bin/docker-init
298 +
299 + pushd components/engine || die
300 + newbin "$(readlink -f bundles/latest/dynbinary-daemon/dockerd)" dockerd
301 +
302 + newinitd contrib/init/openrc/docker.initd docker
303 + newconfd contrib/init/openrc/docker.confd docker
304 +
305 + systemd_dounit contrib/init/systemd/docker.{service,socket}
306 +
307 + udev_dorules contrib/udev/*.rules
308 +
309 + dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
310 + dodoc -r docs/*
311 +
312 + insinto /usr/share/vim/vimfiles
313 + doins -r contrib/syntax/vim/ftdetect
314 + doins -r contrib/syntax/vim/syntax
315 +
316 + # note: intentionally not using "doins" so that we preserve +x bits
317 + dodir /usr/share/${PN}/contrib
318 + cp -R contrib/* "${ED}/usr/share/${PN}/contrib"
319 + popd || die # components/engine
320 +
321 + pushd components/cli || die
322 +
323 + newbin build/docker-* docker
324 +
325 + doman man/man*/*
326 +
327 + dobashcomp contrib/completion/bash/*
328 + insinto /usr/share/zsh/site-functions
329 + doins contrib/completion/zsh/_*
330 + popd || die # components/cli
331 +}
332 +
333 +pkg_postinst() {
334 + udev_reload
335 +
336 + elog
337 + elog "To use Docker, the Docker daemon must be running as root. To automatically"
338 + elog "start the Docker daemon at boot, add Docker to the default runlevel:"
339 + elog " rc-update add docker default"
340 + elog "Similarly for systemd:"
341 + elog " systemctl enable docker.service"
342 + elog
343 + elog "To use Docker as a non-root user, add yourself to the 'docker' group:"
344 + elog " usermod -aG docker youruser"
345 + elog
346 +}