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