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