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: Mon, 11 Feb 2019 17:49:34
Message-Id: 1549907356.3a1c1dbc55bebcdf2971926aa66274872fb2c28d.mrueg@gentoo
1 commit: 3a1c1dbc55bebcdf2971926aa66274872fb2c28d
2 Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
3 AuthorDate: Mon Feb 11 17:49:16 2019 +0000
4 Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
5 CommitDate: Mon Feb 11 17:49:16 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3a1c1dbc
7
8 app-emulation/docker: Version bump to 18.09.2
9
10 Package-Manager: Portage-2.3.59, 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.2.ebuild | 300 +++++++++++++++++++++++++++++
15 2 files changed, 301 insertions(+)
16
17 diff --git a/app-emulation/docker/Manifest b/app-emulation/docker/Manifest
18 index 8ac1a0d9034..e0348a33e56 100644
19 --- a/app-emulation/docker/Manifest
20 +++ b/app-emulation/docker/Manifest
21 @@ -1,3 +1,4 @@
22 DIST docker-18.03.1.tar.gz 12758590 BLAKE2B 98213af07b945fda536e321ef5cc9e272848aab97dcadb7a6b1433b9310fa78015794b5ee4f255448251366a7811e97248b9cc90b0225c528249188768f344ab SHA512 48c4916421cd500ada1bfc2207123a29870939a15a1c7c4a0c082f61c1e3e063381e2345ee9df645dbaca49e002dbfaba70cf6fe233b39a4e1f44fb015807e10
23 DIST docker-18.06.1.tar.gz 13672693 BLAKE2B 7aed2f409914471b3e0eec4f3d024bf59e6505060c1da9c4bb68f0d6efdb5286a8e9e5ee0de19b3f0165c965db27d409f72fceb3f792fc91b9b8dddc8a2b01f0 SHA512 7375452669bf6576e1f8d193cd7f421cf39a26d575351f2b4e433c7fc89384f441547417dbe8c12a12a0937c9fea3800b5c541f0ba8b58ceffe7445183ceeef1
24 DIST docker-18.09.1.tar.gz 15247155 BLAKE2B 5c9a6c0d6e383da2b99341812b0cc1d1498e46decc3b3aaa418607d5f4d725a6842a4462c06357685a32312b90978b0349aaceb69907324761589e68cfae7bca SHA512 9813d3bd41eff63a089495a976226b93d5d43544530aea0ebce78b96e6b4b38389fe3ad1117f1ca95c38727047a24211ad2c2b44217935c26ffb5496cf90407e
25 +DIST docker-18.09.2.tar.gz 15252871 BLAKE2B f87d3a7e6ccb4750eae231b88c686ad9c0be08aa8e0657343c89593d75374dfaeb063f842b8f5cef58e4b64982d3296a6808f076837243e61d75b93ad495fb44 SHA512 eacbeb754cdf2c111a2b72473b437e64cf176a5e93e1a9a0e5ed092d38db5846777d23c4ad51112d8a21317d471e5f1e93f85ae5c0ad1d5d50aea95e226dfa01
26
27 diff --git a/app-emulation/docker/docker-18.09.2.ebuild b/app-emulation/docker/docker-18.09.2.ebuild
28 new file mode 100644
29 index 00000000000..40b6abc8a07
30 --- /dev/null
31 +++ b/app-emulation/docker/docker-18.09.2.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="6247962"
47 + SRC_URI="https://${EGO_PN}/archive/v${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 pkcs11 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.2
90 + ~app-emulation/runc-1.0.0_rc6_p20181203[apparmor?,seccomp?]
91 + >=app-emulation/runc-1.0.0_rc6_p20181203-r1
92 + ~app-emulation/docker-proxy-0.8.0_p20181207
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 +}