Gentoo Archives: gentoo-commits

From: William Hubbs <williamh@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-emulation/docker/
Date: Thu, 10 Jun 2021 21:53:32
Message-Id: 1623361994.1604e66a9fe816e0b9b6abe9518c323b4b2ae9a5.williamh@gentoo
1 commit: 1604e66a9fe816e0b9b6abe9518c323b4b2ae9a5
2 Author: William Hubbs <williamh <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jun 10 21:53:14 2021 +0000
4 Commit: William Hubbs <williamh <AT> gentoo <DOT> org>
5 CommitDate: Thu Jun 10 21:53:14 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1604e66a
7
8 app-emulation/docker: 20.10.7 bump
9
10 Package-Manager: Portage-3.0.18, Repoman-3.0.2
11 Signed-off-by: William Hubbs <williamh <AT> gentoo.org>
12
13 app-emulation/docker/Manifest | 1 +
14 app-emulation/docker/docker-20.10.7.ebuild | 276 +++++++++++++++++++++++++++++
15 2 files changed, 277 insertions(+)
16
17 diff --git a/app-emulation/docker/Manifest b/app-emulation/docker/Manifest
18 index d7d6809f007..0d3d2879bcb 100644
19 --- a/app-emulation/docker/Manifest
20 +++ b/app-emulation/docker/Manifest
21 @@ -1,3 +1,4 @@
22 DIST docker-19.03.15.tar.gz 18284803 BLAKE2B a1fac5d841934382d12c781353546b7c7a8167d0f2dc4150659a4aece210ea7361c59de25e3d450dae20fd536ea8dc33a18e55f9565ee4fdc818166810391fbf SHA512 ffd8e683a93a6ce69789603d24457aebe3379594692cb3dadc25bc8d407771a29d76087b0ca70856707f151622b1853f283a1071311c033ff90a1e44b0d9ffbc
23 DIST docker-20.10.5.tar.gz 11068359 BLAKE2B 16021065f20b6298e47f7b235f522a81ee1cbf046420edf43b241750f39ae19ddee8250090710c124ce09d9c0b20de58378b7df056b37d040a44884e32c5d12d SHA512 620a5345d99be16b4c6ba7321e91e4896128f7d638dfe2220554a6cadeb78b21dd3003cff6db60ed5ffd671ea243b310b21cc1123543b0e0cbfa93eec2900973
24 DIST docker-20.10.6.tar.gz 11075291 BLAKE2B 97bc0d52af178d80701e98af7d313d1c97f0ed96d6682665415ce11976f05a5c39c52684963423e81bcf15772341a005c3bcd0ef4ab6a14da0aff1ead8fbdce2 SHA512 ade6307fe31a3b8f144898ab9c4f2db965965294f15e313b0080ce7aa8bf3296f6f34912b45926ac8c5e74eaf475eef869072878123d27aa432e955f594a94ab
25 +DIST docker-20.10.7.tar.gz 11077660 BLAKE2B 081b36668ead0fd727ebdabc0d07fdf1992f64e3ab1e7c09933130b37f9ad60876c36d1fcda5619ba1bffac7fadafe63d7fc647868c3c6ba30429487c2ebc31b SHA512 2341faa3ebb903d74fa434712fce45e7acf0423710b97cdca11e3999db2819c4385d9a7fb3850925592f20f02c6261edbade6c9d6a2fefbc32f05a6b44ec3073
26
27 diff --git a/app-emulation/docker/docker-20.10.7.ebuild b/app-emulation/docker/docker-20.10.7.ebuild
28 new file mode 100644
29 index 00000000000..6636481017d
30 --- /dev/null
31 +++ b/app-emulation/docker/docker-20.10.7.ebuild
32 @@ -0,0 +1,276 @@
33 +# Copyright 1999-2021 Gentoo Authors
34 +# Distributed under the terms of the GNU General Public License v2
35 +
36 +EAPI=7
37 +EGO_PN=github.com/docker/docker
38 +GIT_COMMIT=8728dd246c
39 +inherit bash-completion-r1 linux-info systemd udev golang-vcs-snapshot
40 +
41 +DESCRIPTION="The core functions you need to create Docker images and run Docker containers"
42 +HOMEPAGE="https://www.docker.com/"
43 +MY_PV=${PV/_/-}
44 +SRC_URI="https://github.com/moby/moby/archive/v${MY_PV}.tar.gz -> ${P}.tar.gz"
45 +
46 +LICENSE="Apache-2.0"
47 +SLOT="0"
48 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
49 +IUSE="apparmor aufs btrfs +cli +container-init device-mapper hardened overlay seccomp"
50 +
51 +DEPEND="
52 + acct-group/docker
53 + >=dev-db/sqlite-3.7.9:3
54 + apparmor? ( sys-libs/libapparmor )
55 + btrfs? ( >=sys-fs/btrfs-progs-3.16.1 )
56 + device-mapper? ( >=sys-fs/lvm2-2.02.89[thin] )
57 + seccomp? ( >=sys-libs/libseccomp-2.2.1 )
58 +"
59 +
60 +# https://github.com/moby/moby/blob/master/project/PACKAGERS.md#runtime-dependencies
61 +# https://github.com/moby/moby/blob/master/project/PACKAGERS.md#optional-dependencies
62 +# https://github.com/moby/moby/tree/master//hack/dockerfile/install
63 +# make sure docker-proxy is pinned to exact version from ^,
64 +# for appropriate branchch/version of course
65 +RDEPEND="
66 + ${DEPEND}
67 + >=net-firewall/iptables-1.4
68 + sys-process/procps
69 + >=dev-vcs/git-1.7
70 + >=app-arch/xz-utils-4.9
71 + dev-libs/libltdl
72 + >=app-emulation/containerd-1.4.6[apparmor?,btrfs?,device-mapper?,seccomp?]
73 + ~app-emulation/docker-proxy-0.8.0_p20210525
74 + cli? ( app-emulation/docker-cli )
75 + container-init? ( >=sys-process/tini-0.19.0[static] )
76 +"
77 +
78 +# https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
79 +BDEPEND="
80 + >=dev-lang/go-1.13.12
81 + dev-go/go-md2man
82 + virtual/pkgconfig
83 +"
84 +# tests require running dockerd as root and downloading containers
85 +RESTRICT="installsources strip test"
86 +
87 +S="${WORKDIR}/${P}/src/${EGO_PN}"
88 +
89 +# https://bugs.gentoo.org/748984 https://github.com/etcd-io/etcd/pull/12552
90 +PATCHES=( "${FILESDIR}/etcd-F_OFD_GETLK-fix.patch" )
91 +
92 +# see "contrib/check-config.sh" from upstream's sources
93 +CONFIG_CHECK="
94 + ~NAMESPACES ~NET_NS ~PID_NS ~IPC_NS ~UTS_NS
95 + ~CGROUPS ~CGROUP_CPUACCT ~CGROUP_DEVICE ~CGROUP_FREEZER ~CGROUP_SCHED ~CPUSETS ~MEMCG
96 + ~CGROUP_NET_PRIO
97 + ~KEYS
98 + ~VETH ~BRIDGE ~BRIDGE_NETFILTER
99 + ~IP_NF_FILTER ~IP_NF_TARGET_MASQUERADE ~NETFILTER_XT_MARK
100 + ~NETFILTER_NETLINK ~NETFILTER_XT_MATCH_ADDRTYPE ~NETFILTER_XT_MATCH_CONNTRACK ~NETFILTER_XT_MATCH_IPVS
101 + ~IP_NF_NAT ~NF_NAT
102 + ~POSIX_MQUEUE
103 +
104 + ~USER_NS
105 + ~SECCOMP
106 + ~CGROUP_PIDS
107 + ~MEMCG_SWAP
108 +
109 + ~BLK_CGROUP ~BLK_DEV_THROTTLING
110 + ~CGROUP_PERF
111 + ~CGROUP_HUGETLB
112 + ~NET_CLS_CGROUP
113 + ~CFS_BANDWIDTH ~FAIR_GROUP_SCHED
114 + ~IP_VS ~IP_VS_PROTO_TCP ~IP_VS_PROTO_UDP ~IP_VS_NFCT ~IP_VS_RR
115 +
116 + ~VXLAN
117 + ~CRYPTO ~CRYPTO_AEAD ~CRYPTO_GCM ~CRYPTO_SEQIV ~CRYPTO_GHASH ~XFRM_ALGO ~XFRM_USER
118 + ~IPVLAN
119 + ~MACVLAN ~DUMMY
120 +
121 + ~OVERLAY_FS ~!OVERLAY_FS_REDIRECT_DIR
122 + ~EXT4_FS_SECURITY
123 + ~EXT4_FS_POSIX_ACL
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 +
139 + if kernel_is lt 4 5; then
140 + CONFIG_CHECK+="
141 + ~MEMCG_KMEM
142 + "
143 + ERROR_MEMCG_KMEM="CONFIG_MEMCG_KMEM: is optional"
144 + fi
145 +
146 + if kernel_is lt 4 7; then
147 + CONFIG_CHECK+="
148 + ~DEVPTS_MULTIPLE_INSTANCES
149 + "
150 + fi
151 +
152 + if kernel_is lt 5 1; then
153 + CONFIG_CHECK+="
154 + ~NF_NAT_IPV4
155 + ~IOSCHED_CFQ
156 + ~CFQ_GROUP_IOSCHED
157 + "
158 + fi
159 +
160 + if kernel_is lt 5 2; then
161 + CONFIG_CHECK+="
162 + ~NF_NAT_NEEDED
163 + "
164 + fi
165 +
166 + if kernel_is lt 5 8; then
167 + CONFIG_CHECK+="
168 + ~MEMCG_SWAP_ENABLED
169 + "
170 + fi
171 +
172 + if use aufs; then
173 + CONFIG_CHECK+="
174 + ~AUFS_FS
175 + ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
176 + "
177 + ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs is patched to kernel instead of using standalone"
178 + fi
179 +
180 + if use btrfs; then
181 + CONFIG_CHECK+="
182 + ~BTRFS_FS
183 + ~BTRFS_FS_POSIX_ACL
184 + "
185 + fi
186 +
187 + if use device-mapper; then
188 + CONFIG_CHECK+="
189 + ~BLK_DEV_DM ~DM_THIN_PROVISIONING ~EXT4_FS ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
190 + "
191 + fi
192 +
193 + linux-info_pkg_setup
194 +}
195 +
196 +src_compile() {
197 + export DOCKER_GITCOMMIT="${GIT_COMMIT}"
198 + export GOPATH="${WORKDIR}/${P}"
199 + export VERSION=${PV}
200 +
201 + # setup CFLAGS and LDFLAGS for separate build target
202 + # see https://github.com/tianon/docker-overlay/pull/10
203 + export CGO_CFLAGS="-I${ESYSROOT}/usr/include"
204 + export CGO_LDFLAGS="-L${ESYSROOT}/usr/$(get_libdir)"
205 +
206 + # let's set up some optional features :)
207 + export DOCKER_BUILDTAGS=''
208 + for gd in aufs btrfs device-mapper overlay; do
209 + if ! use $gd; then
210 + DOCKER_BUILDTAGS+=" exclude_graphdriver_${gd//-/}"
211 + fi
212 + done
213 +
214 + for tag in apparmor seccomp; do
215 + if use $tag; then
216 + DOCKER_BUILDTAGS+=" $tag"
217 + fi
218 + done
219 +
220 + if use hardened; then
221 + sed -i "s/EXTLDFLAGS_STATIC='/&-fno-PIC /" hack/make.sh || die
222 + grep -q -- '-fno-PIC' hack/make.sh || die 'hardened sed failed'
223 + sed "s/LDFLAGS_STATIC_DOCKER='/&-extldflags -fno-PIC /" \
224 + -i hack/make/dynbinary-daemon || die
225 + grep -q -- '-fno-PIC' hack/make/dynbinary-daemon || die 'hardened sed failed'
226 + fi
227 +
228 + # build daemon
229 + ./hack/make.sh dynbinary || die 'dynbinary failed'
230 +}
231 +
232 +src_install() {
233 + dosym containerd /usr/bin/docker-containerd
234 + dosym containerd-shim /usr/bin/docker-containerd-shim
235 + dosym runc /usr/bin/docker-runc
236 + use container-init && dosym tini /usr/bin/docker-init
237 + newbin bundles/dynbinary-daemon/dockerd dockerd
238 +
239 + newinitd contrib/init/openrc/docker.initd docker
240 + newconfd contrib/init/openrc/docker.confd docker
241 +
242 + systemd_dounit contrib/init/systemd/docker.{service,socket}
243 +
244 + udev_dorules contrib/udev/*.rules
245 +
246 + dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
247 + dodoc -r docs/*
248 +
249 + # note: intentionally not using "doins" so that we preserve +x bits
250 + dodir /usr/share/${PN}/contrib
251 + cp -R contrib/* "${ED}/usr/share/${PN}/contrib"
252 +}
253 +
254 +pkg_postinst() {
255 + udev_reload
256 +
257 + elog
258 + elog "To use Docker, the Docker daemon must be running as root. To automatically"
259 + elog "start the Docker daemon at boot:"
260 + if systemd_is_booted || has_version sys-apps/systemd; then
261 + elog " systemctl enable docker.service"
262 + else
263 + elog " rc-update add docker default"
264 + fi
265 + elog
266 + elog "To use Docker as a non-root user, add yourself to the 'docker' group:"
267 + elog ' usermod -aG docker <youruser>'
268 + elog
269 +
270 + if use device-mapper; then
271 + elog " Devicemapper storage driver has been deprecated"
272 + elog " It will be removed in a future release"
273 + elog
274 + fi
275 +
276 + if use overlay; then
277 + elog " Overlay storage driver/USEflag has been deprecated"
278 + elog " in favor of overlay2 (enabled unconditionally)"
279 + elog
280 + fi
281 +
282 + if has_version sys-fs/zfs; then
283 + elog " ZFS storage driver is available"
284 + elog " Check https://docs.docker.com/storage/storagedriver/zfs-driver for more info"
285 + elog
286 + fi
287 +
288 + if use cli; then
289 + ewarn "Starting with docker 20.10.2, docker has been split into"
290 + ewarn "two packages upstream, so Gentoo has followed suit."
291 + ewarn
292 + ewarn "app-emulation/docker contains the daemon and"
293 + ewarn "app-emulation/docker-cli contains the docker command."
294 + ewarn
295 + ewarn "docker currently installs docker-cli using the cli use flag."
296 + ewarn
297 + ewarn "This use flag is temporary, so you need to take the"
298 + ewarn "following actions:"
299 + ewarn
300 + ewarn "First, disable the cli use flag for app-emulation/docker"
301 + ewarn
302 + ewarn "Then, if you need docker-cli and docker on the same machine,"
303 + ewarn "run the following command:"
304 + ewarn
305 + ewarn "# emerge --noreplace docker-cli"
306 + ewarn
307 + fi
308 +}