Gentoo Archives: gentoo-commits

From: Georgy Yakovlev <gyakovlev@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/docker/
Date: Wed, 02 Dec 2020 19:56:26
Message-Id: 1606938581.a5fcf07ed40a899fcb1a6ba66cb981f2349b75d4.gyakovlev@gentoo
1 commit: a5fcf07ed40a899fcb1a6ba66cb981f2349b75d4
2 Author: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 2 19:45:31 2020 +0000
4 Commit: Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 2 19:49:41 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5fcf07e
7
8 app-emulation/docker: bump to 19.03.14
9
10 Package-Manager: Portage-3.0.11, Repoman-3.0.2
11 Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>
12
13 app-emulation/docker/Manifest | 1 +
14 app-emulation/docker/docker-19.03.14.ebuild | 333 ++++++++++++++++++++++++++++
15 2 files changed, 334 insertions(+)
16
17 diff --git a/app-emulation/docker/Manifest b/app-emulation/docker/Manifest
18 index 132fbb0adbc..8ad8811b1bb 100644
19 --- a/app-emulation/docker/Manifest
20 +++ b/app-emulation/docker/Manifest
21 @@ -1 +1,2 @@
22 DIST docker-19.03.13.tar.gz 18242693 BLAKE2B c19afed62694274298b42fc9af3b36c4cc6429b40f7e5447a996b87636a0d2e916476875652e20abd7aeab4e5e0e1cf887a04dcade1de03ded549fc36d911ac4 SHA512 5f34a14ef0b36a309d4a08926ac482ca82d24cdd873aa359c5ba7c65473cbb2e987fe615c38c1bc1c50135284da78a7eb98a8a0106d7d073aeda0cd8f1c31873
23 +DIST docker-19.03.14.tar.gz 18278132 BLAKE2B 5e32cb482fdc40531aa4ba79dd447093859f568b3d8b5c3ed584c78d5709fabf2a1e05e82af2686cd87462e1abd899bd3f0a746f97937b7d16950f5e94264dff SHA512 5e48185a7787d5637fc11f43f6af604d56a5fa4367fd5a558bb3a5ef3c0d767f1c7f83ecef369453696b68eed81e49520453f267fbe8c2b840b3f62d35f25c28
24
25 diff --git a/app-emulation/docker/docker-19.03.14.ebuild b/app-emulation/docker/docker-19.03.14.ebuild
26 new file mode 100644
27 index 00000000000..5801221750c
28 --- /dev/null
29 +++ b/app-emulation/docker/docker-19.03.14.ebuild
30 @@ -0,0 +1,333 @@
31 +# Copyright 1999-2020 Gentoo Authors
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=7
35 +
36 +EGO_PN="github.com/docker/docker-ce"
37 +
38 +if [[ ${PV} = *9999* ]]; then
39 + # Docker cannot be fetched via "go get", thanks to autogenerated code
40 + EGIT_REPO_URI="https://${EGO_PN}.git"
41 + EGIT_CHECKOUT_DIR="${WORKDIR}/${P}/src/${EGO_PN}"
42 + inherit git-r3
43 +else
44 + DOCKER_GITCOMMIT="5eb3275"
45 + MY_PV=${PV/_/-}
46 + SRC_URI="https://${EGO_PN}/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
47 + KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
48 + [ "$DOCKER_GITCOMMIT" ] || die "DOCKER_GITCOMMIT must be added manually for each bump!"
49 + inherit golang-vcs-snapshot
50 +fi
51 +inherit bash-completion-r1 golang-base linux-info systemd udev
52 +
53 +DESCRIPTION="The core functions you need to create Docker images and run Docker containers"
54 +HOMEPAGE="https://www.docker.com/"
55 +LICENSE="Apache-2.0"
56 +SLOT="0"
57 +IUSE="apparmor aufs btrfs +container-init device-mapper hardened overlay seccomp selinux"
58 +
59 +# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
60 +BDEPEND="
61 + >=dev-lang/go-1.13.12
62 + dev-go/go-md2man
63 + virtual/pkgconfig
64 +"
65 +
66 +DEPEND="
67 + acct-group/docker
68 + >=dev-db/sqlite-3.7.9:3
69 + apparmor? ( sys-libs/libapparmor )
70 + btrfs? ( >=sys-fs/btrfs-progs-3.16.1 )
71 + device-mapper? ( >=sys-fs/lvm2-2.02.89[thin] )
72 + seccomp? ( >=sys-libs/libseccomp-2.2.1 )
73 +"
74 +
75 +# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#runtime-dependencies
76 +# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#optional-dependencies
77 +# https://github.com/docker/docker-ce/tree/master/components/engine/hack/dockerfile/install
78 +# make sure containerd, docker-proxy, runc and tini pinned to exact versions from ^,
79 +# for appropriate brachch/version of course
80 +RDEPEND="
81 + ${DEPEND}
82 + !sys-apps/systemd[-cgroup-hybrid(+)]
83 + >=net-firewall/iptables-1.4
84 + sys-process/procps
85 + >=dev-vcs/git-1.7
86 + >=app-arch/xz-utils-4.9
87 + dev-libs/libltdl
88 + ~app-emulation/containerd-1.3.9[apparmor?,btrfs?,device-mapper?,seccomp?,selinux?]
89 + ~app-emulation/runc-1.0.0_rc10[apparmor?,seccomp?,selinux(-)?]
90 + ~app-emulation/docker-proxy-0.8.0_p20201105
91 + container-init? ( >=sys-process/tini-0.18.0[static] )
92 +"
93 +
94 +RESTRICT="installsources strip"
95 +
96 +S="${WORKDIR}/${P}/src/${EGO_PN}"
97 +
98 +# see "contrib/check-config.sh" from upstream's sources
99 +CONFIG_CHECK="
100 + ~NAMESPACES ~NET_NS ~PID_NS ~IPC_NS ~UTS_NS
101 + ~CGROUPS ~CGROUP_CPUACCT ~CGROUP_DEVICE ~CGROUP_FREEZER ~CGROUP_SCHED ~CPUSETS ~MEMCG
102 + ~KEYS
103 + ~VETH ~BRIDGE ~BRIDGE_NETFILTER
104 + ~IP_NF_FILTER ~IP_NF_TARGET_MASQUERADE
105 + ~NETFILTER_NETLINK ~NETFILTER_XT_MATCH_ADDRTYPE ~NETFILTER_XT_MATCH_CONNTRACK ~NETFILTER_XT_MATCH_IPVS
106 + ~IP_NF_NAT ~NF_NAT
107 + ~POSIX_MQUEUE
108 +
109 + ~USER_NS
110 + ~SECCOMP
111 + ~CGROUP_PIDS
112 + ~MEMCG_SWAP
113 +
114 + ~BLK_CGROUP ~BLK_DEV_THROTTLING
115 + ~CGROUP_PERF
116 + ~CGROUP_HUGETLB
117 + ~NET_CLS_CGROUP
118 + ~CFS_BANDWIDTH ~FAIR_GROUP_SCHED ~RT_GROUP_SCHED
119 + ~IP_VS ~IP_VS_PROTO_TCP ~IP_VS_PROTO_UDP ~IP_VS_NFCT ~IP_VS_RR
120 +
121 + ~VXLAN
122 + ~CRYPTO ~CRYPTO_AEAD ~CRYPTO_GCM ~CRYPTO_SEQIV ~CRYPTO_GHASH ~XFRM_ALGO ~XFRM_USER
123 + ~IPVLAN
124 + ~MACVLAN ~DUMMY
125 +
126 + ~OVERLAY_FS ~!OVERLAY_FS_REDIRECT_DIR
127 + ~EXT4_FS_SECURITY
128 + ~EXT4_FS_POSIX_ACL
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 + if kernel_is le 3 18; then
150 + CONFIG_CHECK+="
151 + ~RESOURCE_COUNTERS
152 + "
153 + fi
154 +
155 + if kernel_is le 3 13; then
156 + CONFIG_CHECK+="
157 + ~NETPRIO_CGROUP
158 + "
159 + else
160 + CONFIG_CHECK+="
161 + ~CGROUP_NET_PRIO
162 + "
163 + fi
164 +
165 + if kernel_is lt 4 5; then
166 + CONFIG_CHECK+="
167 + ~MEMCG_KMEM
168 + "
169 + ERROR_MEMCG_KMEM="CONFIG_MEMCG_KMEM: is optional"
170 + fi
171 +
172 + if kernel_is lt 4 7; then
173 + CONFIG_CHECK+="
174 + ~DEVPTS_MULTIPLE_INSTANCES
175 + "
176 + fi
177 +
178 + if kernel_is lt 5 1; then
179 + CONFIG_CHECK+="
180 + ~NF_NAT_IPV4
181 + ~IOSCHED_CFQ
182 + ~CFQ_GROUP_IOSCHED
183 + "
184 + fi
185 +
186 + if kernel_is lt 5 2; then
187 + CONFIG_CHECK+="
188 + ~NF_NAT_NEEDED
189 + "
190 + fi
191 +
192 + if kernel_is lt 5 8; then
193 + CONFIG_CHECK+="
194 + ~MEMCG_SWAP_ENABLED
195 + "
196 + fi
197 +
198 + if use aufs; then
199 + CONFIG_CHECK+="
200 + ~AUFS_FS
201 + ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
202 + "
203 + ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs-sources are used instead of aufs4/aufs3"
204 + fi
205 +
206 + if use btrfs; then
207 + CONFIG_CHECK+="
208 + ~BTRFS_FS
209 + ~BTRFS_FS_POSIX_ACL
210 + "
211 + fi
212 +
213 + if use device-mapper; then
214 + CONFIG_CHECK+="
215 + ~BLK_DEV_DM ~DM_THIN_PROVISIONING ~EXT4_FS ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
216 + "
217 + fi
218 +
219 + linux-info_pkg_setup
220 +}
221 +
222 +src_compile() {
223 + export GOPATH="${WORKDIR}/${P}"
224 +
225 + # setup CFLAGS and LDFLAGS for separate build target
226 + # see https://github.com/tianon/docker-overlay/pull/10
227 + export CGO_CFLAGS="-I${ROOT}/usr/include"
228 + export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
229 +
230 + # if we're building from a tarball, we need the GITCOMMIT value
231 + [[ ${DOCKER_GITCOMMIT} ]] && export DOCKER_GITCOMMIT
232 +
233 + # fake golang layout
234 + ln -s docker-ce/components/engine ../docker || die
235 + ln -s docker-ce/components/cli ../cli || die
236 +
237 + # let's set up some optional features :)
238 + export DOCKER_BUILDTAGS=''
239 + for gd in aufs btrfs device-mapper overlay; do
240 + if ! use $gd; then
241 + DOCKER_BUILDTAGS+=" exclude_graphdriver_${gd//-/}"
242 + fi
243 + done
244 +
245 + for tag in apparmor seccomp selinux; do
246 + if use $tag; then
247 + DOCKER_BUILDTAGS+=" $tag"
248 + fi
249 + done
250 +
251 + pushd components/engine || die
252 +
253 + if use hardened; then
254 + sed -i "s/EXTLDFLAGS_STATIC='/&-fno-PIC /" hack/make.sh || die
255 + grep -q -- '-fno-PIC' hack/make.sh || die 'hardened sed failed'
256 + sed "s/LDFLAGS_STATIC_DOCKER='/&-extldflags -fno-PIC /" \
257 + -i hack/make/dynbinary-daemon || die
258 + grep -q -- '-fno-PIC' hack/make/dynbinary-daemon || die 'hardened sed failed'
259 + fi
260 +
261 + # build daemon
262 + VERSION="$(cat ../../VERSION)" \
263 + ./hack/make.sh dynbinary || die 'dynbinary failed'
264 +
265 + popd || die # components/engine
266 +
267 + pushd components/cli || die
268 +
269 + # build cli
270 + DISABLE_WARN_OUTSIDE_CONTAINER=1 emake \
271 + LDFLAGS="$(usex hardened '-extldflags -fno-PIC' '')" \
272 + VERSION="$(cat ../../VERSION)" \
273 + GITCOMMIT="${DOCKER_GITCOMMIT}" \
274 + dynbinary
275 +
276 + # build man pages
277 + go build -o gen-manpages github.com/docker/cli/man || die
278 + ./gen-manpages --root . --target ./man/man1 || die
279 + ./man/md2man-all.sh -q || die
280 + rm gen-manpages || die
281 + # see "components/cli/scripts/docs/generate-man.sh" (which also does "go get" for go-md2man)
282 +
283 + popd || die # components/cli
284 +}
285 +
286 +src_install() {
287 + dosym containerd /usr/bin/docker-containerd
288 + dosym containerd-shim /usr/bin/docker-containerd-shim
289 + dosym runc /usr/bin/docker-runc
290 + use container-init && dosym tini /usr/bin/docker-init
291 +
292 + pushd components/engine || die
293 + newbin bundles/dynbinary-daemon/dockerd-${PV} dockerd
294 +
295 + newinitd contrib/init/openrc/docker.initd docker
296 + newconfd contrib/init/openrc/docker.confd docker
297 +
298 + systemd_dounit contrib/init/systemd/docker.{service,socket}
299 +
300 + udev_dorules contrib/udev/*.rules
301 +
302 + dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
303 + dodoc -r docs/*
304 +
305 + insinto /usr/share/vim/vimfiles
306 + doins -r contrib/syntax/vim/ftdetect
307 + doins -r contrib/syntax/vim/syntax
308 +
309 + # note: intentionally not using "doins" so that we preserve +x bits
310 + dodir /usr/share/${PN}/contrib
311 + cp -R contrib/* "${ED}/usr/share/${PN}/contrib"
312 + popd || die # components/engine
313 +
314 + pushd components/cli || die
315 +
316 + newbin build/docker-* docker
317 +
318 + doman man/man*/*
319 +
320 + sed -i 's@dockerd\?\.exe@@g' contrib/completion/bash/docker || die
321 + dobashcomp contrib/completion/bash/*
322 + bashcomp_alias docker dockerd
323 + insinto /usr/share/fish/vendor_completions.d/
324 + doins contrib/completion/fish/docker.fish
325 + insinto /usr/share/zsh/site-functions
326 + doins contrib/completion/zsh/_*
327 + popd || die # components/cli
328 +}
329 +
330 +pkg_postinst() {
331 + udev_reload
332 +
333 + elog
334 + elog "To use Docker, the Docker daemon must be running as root. To automatically"
335 + elog "start the Docker daemon at boot:"
336 + if systemd_is_booted || has_version sys-apps/systemd; then
337 + elog " systemctl enable docker.service"
338 + else
339 + elog " rc-update add docker default"
340 + fi
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 +
346 + if use device-mapper; then
347 + elog " Devicemapper storage driver has been deprecated"
348 + elog " It will be removed in a future release"
349 + elog
350 + fi
351 +
352 + if use overlay; then
353 + elog " Overlay storage driver/USEflag has been deprecated"
354 + elog " in favor of overlay2 (enabled unconditionally)"
355 + elog
356 + fi
357 +
358 + if has_version sys-fs/zfs; then
359 + elog " ZFS storage driver is available"
360 + elog " Check https://docs.docker.com/storage/storagedriver/zfs-driver for more info"
361 + elog
362 + fi
363 +}