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