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