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, 25 Jun 2019 15:44:04
Message-Id: 1561477419.33b68b9ee03a50b1c84c33deb1d523768c60967d.mrueg@gentoo
1 commit: 33b68b9ee03a50b1c84c33deb1d523768c60967d
2 Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jun 25 15:43:39 2019 +0000
4 Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
5 CommitDate: Tue Jun 25 15:43:39 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33b68b9e
7
8 app-emulation/docker: Version bump to 18.09.7_rc1
9
10 Package-Manager: Portage-2.3.67, Repoman-2.3.16
11 Signed-off-by: Manuel Rüger <mrueg <AT> gentoo.org>
12
13 app-emulation/docker/Manifest | 1 +
14 app-emulation/docker/docker-18.09.7_rc1.ebuild | 300 +++++++++++++++++++++++++
15 2 files changed, 301 insertions(+)
16
17 diff --git a/app-emulation/docker/Manifest b/app-emulation/docker/Manifest
18 index 40619db8ec7..162e9f958f7 100644
19 --- a/app-emulation/docker/Manifest
20 +++ b/app-emulation/docker/Manifest
21 @@ -1,3 +1,4 @@
22 DIST docker-18.09.5.tar.gz 15256899 BLAKE2B c55ef822b3e655b0bec9585de6ee346e73d48d388225141097768db9f5ddaeca2d1937274a7131e3e301686e2214a9ed2051dd72c07893bcfccb00424d02df73 SHA512 a6012d202761d6449e347b03759d92f5f45309e72562fd4a619b2a21c62b3f50b1256d2e4820317aa6b412f1eecda66dbd960d322293699433417a5f7ee73486
23 DIST docker-18.09.6.tar.gz 15257416 BLAKE2B e0f93f09c403f043d3b2f390d50da83565b0520d18b695a8166aa240817cc713eb9eff314d4c7eeba242c25e35c0b6a9ea3a7f1d661d6aca4a40f7e77856a05d SHA512 f05fc78f5891fa0308878690576e245eebb1e72f306f5b629b0e82dc96a04812202a2393ee6fd352bc59a1c5d29d398f0d6cddf545d57b483a051d14d7a0ee28
24 DIST docker-18.09.6_p20190604.tar.gz 15259344 BLAKE2B f958063ab9fc851fda13117210dade6b7fb211426c9565c62f2786a2b5878194ea052f866da1b2e489bd75d622cdf77bafccc538377cc5c261f86f50163cb151 SHA512 da518f07cfd9f90ad46796f5047156ef517fa75ff27daa16ab16b868b7f1c9822cb61ce2ee558b1632c4acfdd8d74a608f5b6cb5cb5ca932aca5bf42d497d6a9
25 +DIST docker-18.09.7_rc1.tar.gz 15264071 BLAKE2B d124cff1e32cedda35d8d0fac074a2227d078673639e99a1313e42b73b2c84b0c97af5470d3d4c8f2684e93898ab9d081fe536cd4e428ef8a8a5639761bd380b SHA512 377a07c7a1515a8f08c412d2117e10d9c9100a4a55dc5df69e8a8b822362b0b41812b3d4ee8fc8a1e7bc7258c15ee3da6aa42c7bc71fd86def1f6cda9f1566cd
26
27 diff --git a/app-emulation/docker/docker-18.09.7_rc1.ebuild b/app-emulation/docker/docker-18.09.7_rc1.ebuild
28 new file mode 100644
29 index 00000000000..445bb43dc5a
30 --- /dev/null
31 +++ b/app-emulation/docker/docker-18.09.7_rc1.ebuild
32 @@ -0,0 +1,300 @@
33 +# Copyright 1999-2019 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=6
37 +
38 +EGO_PN="github.com/docker/docker-ce"
39 +
40 +if [[ ${PV} = *9999* ]]; then
41 + # Docker cannot be fetched via "go get", thanks to autogenerated code
42 + EGIT_REPO_URI="https://${EGO_PN}.git"
43 + EGIT_CHECKOUT_DIR="${WORKDIR}/${P}/src/${EGO_PN}"
44 + inherit git-r3
45 +else
46 + DOCKER_GITCOMMIT="e97b22c"
47 + MY_PV=${PV/_/-}
48 + SRC_URI="https://${EGO_PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
49 + KEYWORDS="~amd64 ~arm ~arm64"
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 + >=net-firewall/iptables-1.4
86 + sys-process/procps
87 + >=dev-vcs/git-1.7
88 + >=app-arch/xz-utils-4.9
89 + dev-libs/libltdl
90 + ~app-emulation/containerd-1.2.6
91 + ~app-emulation/runc-1.0.0_rc8[apparmor?,seccomp?]
92 + ~app-emulation/docker-proxy-0.8.0_p20190513
93 + container-init? ( >=sys-process/tini-0.18.0[static] )
94 +"
95 +
96 +RESTRICT="installsources strip"
97 +
98 +S="${WORKDIR}/${P}/src/${EGO_PN}"
99 +
100 +# see "contrib/check-config.sh" from upstream's sources
101 +CONFIG_CHECK="
102 + ~NAMESPACES ~NET_NS ~PID_NS ~IPC_NS ~UTS_NS
103 + ~CGROUPS ~CGROUP_CPUACCT ~CGROUP_DEVICE ~CGROUP_FREEZER ~CGROUP_SCHED ~CPUSETS ~MEMCG
104 + ~KEYS
105 + ~VETH ~BRIDGE ~BRIDGE_NETFILTER
106 + ~NF_NAT_IPV4 ~IP_NF_FILTER ~IP_NF_TARGET_MASQUERADE
107 + ~NETFILTER_XT_MATCH_ADDRTYPE ~NETFILTER_XT_MATCH_CONNTRACK ~NETFILTER_XT_MATCH_IPVS
108 + ~IP_NF_NAT ~NF_NAT ~NF_NAT_NEEDED
109 + ~POSIX_MQUEUE
110 +
111 + ~USER_NS
112 + ~SECCOMP
113 + ~CGROUP_PIDS
114 + ~MEMCG_SWAP ~MEMCG_SWAP_ENABLED
115 +
116 + ~BLK_CGROUP ~BLK_DEV_THROTTLING ~IOSCHED_CFQ ~CFQ_GROUP_IOSCHED
117 + ~CGROUP_PERF
118 + ~CGROUP_HUGETLB
119 + ~NET_CLS_CGROUP
120 + ~CFS_BANDWIDTH ~FAIR_GROUP_SCHED ~RT_GROUP_SCHED
121 + ~IP_VS ~IP_VS_PROTO_TCP ~IP_VS_PROTO_UDP ~IP_VS_NFCT ~IP_VS_RR
122 +
123 + ~VXLAN
124 + ~CRYPTO ~CRYPTO_AEAD ~CRYPTO_GCM ~CRYPTO_SEQIV ~CRYPTO_GHASH ~XFRM_ALGO ~XFRM_USER
125 + ~IPVLAN
126 + ~MACVLAN ~DUMMY
127 +"
128 +
129 +ERROR_KEYS="CONFIG_KEYS: is mandatory"
130 +ERROR_MEMCG_SWAP="CONFIG_MEMCG_SWAP: is required if you wish to limit swap usage of containers"
131 +ERROR_RESOURCE_COUNTERS="CONFIG_RESOURCE_COUNTERS: is optional for container statistics gathering"
132 +
133 +ERROR_BLK_CGROUP="CONFIG_BLK_CGROUP: is optional for container statistics gathering"
134 +ERROR_IOSCHED_CFQ="CONFIG_IOSCHED_CFQ: is optional for container statistics gathering"
135 +ERROR_CGROUP_PERF="CONFIG_CGROUP_PERF: is optional for container statistics gathering"
136 +ERROR_CFS_BANDWIDTH="CONFIG_CFS_BANDWIDTH: is optional for container statistics gathering"
137 +ERROR_XFRM_ALGO="CONFIG_XFRM_ALGO: is optional for secure networks"
138 +ERROR_XFRM_USER="CONFIG_XFRM_USER: is optional for secure networks"
139 +
140 +pkg_setup() {
141 + if kernel_is lt 3 10; then
142 + ewarn ""
143 + ewarn "Using Docker with kernels older than 3.10 is unstable and unsupported."
144 + ewarn " - http://docs.docker.com/engine/installation/binaries/#check-kernel-dependencies"
145 + fi
146 +
147 + if kernel_is le 3 18; then
148 + CONFIG_CHECK+="
149 + ~RESOURCE_COUNTERS
150 + "
151 + fi
152 +
153 + if kernel_is le 3 13; then
154 + CONFIG_CHECK+="
155 + ~NETPRIO_CGROUP
156 + "
157 + else
158 + CONFIG_CHECK+="
159 + ~CGROUP_NET_PRIO
160 + "
161 + fi
162 +
163 + if kernel_is lt 4 5; then
164 + CONFIG_CHECK+="
165 + ~MEMCG_KMEM
166 + "
167 + ERROR_MEMCG_KMEM="CONFIG_MEMCG_KMEM: is optional"
168 + fi
169 +
170 + if kernel_is lt 4 7; then
171 + CONFIG_CHECK+="
172 + ~DEVPTS_MULTIPLE_INSTANCES
173 + "
174 + fi
175 +
176 + if use aufs; then
177 + CONFIG_CHECK+="
178 + ~AUFS_FS
179 + ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
180 + "
181 + ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs-sources are used instead of aufs4/aufs3"
182 + fi
183 +
184 + if use btrfs; then
185 + CONFIG_CHECK+="
186 + ~BTRFS_FS
187 + ~BTRFS_FS_POSIX_ACL
188 + "
189 + fi
190 +
191 + if use device-mapper; then
192 + CONFIG_CHECK+="
193 + ~BLK_DEV_DM ~DM_THIN_PROVISIONING ~EXT4_FS ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
194 + "
195 + fi
196 +
197 + if use overlay; then
198 + CONFIG_CHECK+="
199 + ~OVERLAY_FS ~EXT4_FS_SECURITY ~EXT4_FS_POSIX_ACL
200 + "
201 + fi
202 +
203 + linux-info_pkg_setup
204 +
205 + # create docker group for the code checking for it in /etc/group
206 + enewgroup docker
207 +}
208 +
209 +src_compile() {
210 + export GOPATH="${WORKDIR}/${P}"
211 +
212 + # setup CFLAGS and LDFLAGS for separate build target
213 + # see https://github.com/tianon/docker-overlay/pull/10
214 + export CGO_CFLAGS="-I${ROOT}/usr/include"
215 + export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
216 +
217 + # if we're building from a tarball, we need the GITCOMMIT value
218 + [ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
219 +
220 + # fake golang layout
221 + ln -s docker-ce/components/engine ../docker || die
222 + ln -s docker-ce/components/cli ../cli || die
223 +
224 + # let's set up some optional features :)
225 + export DOCKER_BUILDTAGS=''
226 + for gd in aufs btrfs device-mapper overlay; do
227 + if ! use $gd; then
228 + DOCKER_BUILDTAGS+=" exclude_graphdriver_${gd//-/}"
229 + fi
230 + done
231 +
232 + for tag in apparmor pkcs11 seccomp; do
233 + if use $tag; then
234 + DOCKER_BUILDTAGS+=" $tag"
235 + fi
236 + done
237 +
238 + pushd components/engine || die
239 +
240 + if use hardened; then
241 + sed -i "s/EXTLDFLAGS_STATIC='/&-fno-PIC /" hack/make.sh || die
242 + grep -q -- '-fno-PIC' hack/make.sh || die 'hardened sed failed'
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 + fi
247 +
248 + # build daemon
249 + VERSION="$(cat ../../VERSION)" \
250 + ./hack/make.sh dynbinary || die 'dynbinary failed'
251 +
252 + popd || die # components/engine
253 +
254 + pushd components/cli || die
255 +
256 + # build cli
257 + emake \
258 + LDFLAGS="$(usex hardened '-extldflags -fno-PIC' '')" \
259 + VERSION="$(cat ../../VERSION)" \
260 + GITCOMMIT="${DOCKER_GITCOMMIT}" \
261 + DISABLE_WARN_OUTSIDE_CONTAINER=1 \
262 + dynbinary || die
263 +
264 + # build man pages
265 + go build -o gen-manpages github.com/docker/cli/man || die
266 + ./gen-manpages --root . --target ./man/man1 || die
267 + ./man/md2man-all.sh -q || die
268 + rm gen-manpages || die
269 + # see "components/cli/scripts/docs/generate-man.sh" (which also does "go get" for go-md2man)
270 +
271 + popd || die # components/cli
272 +}
273 +
274 +src_install() {
275 + dosym containerd /usr/bin/docker-containerd
276 + dosym containerd-shim /usr/bin/docker-containerd-shim
277 + dosym runc /usr/bin/docker-runc
278 + use container-init && dosym tini /usr/bin/docker-init
279 +
280 + pushd components/engine || die
281 + newbin "$(readlink -f bundles/latest/dynbinary-daemon/dockerd)" dockerd
282 +
283 + newinitd contrib/init/openrc/docker.initd docker
284 + newconfd contrib/init/openrc/docker.confd docker
285 +
286 + systemd_dounit contrib/init/systemd/docker.{service,socket}
287 +
288 + udev_dorules contrib/udev/*.rules
289 +
290 + dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
291 + dodoc -r docs/*
292 +
293 + insinto /usr/share/vim/vimfiles
294 + doins -r contrib/syntax/vim/ftdetect
295 + doins -r contrib/syntax/vim/syntax
296 +
297 + # note: intentionally not using "doins" so that we preserve +x bits
298 + dodir /usr/share/${PN}/contrib
299 + cp -R contrib/* "${ED}/usr/share/${PN}/contrib"
300 + popd || die # components/engine
301 +
302 + pushd components/cli || die
303 +
304 + newbin build/docker-* docker
305 +
306 + doman man/man*/*
307 +
308 + dobashcomp contrib/completion/bash/*
309 + insinto /usr/share/fish/vendor_completions.d/
310 + doins contrib/completion/fish/docker.fish
311 + insinto /usr/share/zsh/site-functions
312 + doins contrib/completion/zsh/_*
313 + popd || die # components/cli
314 +}
315 +
316 +pkg_postinst() {
317 + udev_reload
318 +
319 + elog
320 + elog "To use Docker, the Docker daemon must be running as root. To automatically"
321 + elog "start the Docker daemon at boot, add Docker to the default runlevel:"
322 + elog " rc-update add docker default"
323 + elog "Similarly for systemd:"
324 + elog " systemctl enable docker.service"
325 + elog
326 + elog "To use Docker as a non-root user, add yourself to the 'docker' group:"
327 + elog " usermod -aG docker youruser"
328 + elog
329 +
330 + elog " Devicemapper storage driver has been deprecated"
331 + elog " It will be removed in a future release"
332 +}