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, 06 Mar 2017 16:28:48
Message-Id: 1488817683.80d55d555aa2df9723c31a1fa765e80ab1395172.mrueg@gentoo
1 commit: 80d55d555aa2df9723c31a1fa765e80ab1395172
2 Author: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
3 AuthorDate: Mon Mar 6 16:28:03 2017 +0000
4 Commit: Manuel Rüger <mrueg <AT> gentoo <DOT> org>
5 CommitDate: Mon Mar 6 16:28:03 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=80d55d55
7
8 app-emulation/docker: Version bump to 17.03.0
9
10 Package-Manager: Portage-2.3.4, Repoman-2.3.2
11
12 app-emulation/docker/Manifest | 1 +
13 app-emulation/docker/docker-17.03.0.ebuild | 292 +++++++++++++++++++++++++++++
14 2 files changed, 293 insertions(+)
15
16 diff --git a/app-emulation/docker/Manifest b/app-emulation/docker/Manifest
17 index d8063e048f5..baae416ad32 100644
18 --- a/app-emulation/docker/Manifest
19 +++ b/app-emulation/docker/Manifest
20 @@ -1,2 +1,3 @@
21 DIST docker-1.12.6.tar.gz 13694205 SHA256 0413f3513c2a6842ed9cf837154c8a722e9b34cb36b33430348489baa183707e SHA512 98e0fa0ec0dad4d392188b0d2cf42b2b564403463c369e1fe060f1abc2e97d97375a88587080671ef905e6a34b991d83265f43c3112575af019cf85eef0c2c25 WHIRLPOOL 55d10e4c4ab960320094637a847768ad85dc1fccaa6cc77ea0ca82f2d23b27e92e2f2c0cbc03f53676012c95883f65c6fa16d26970138fa129d37bf278fc8c0b
22 DIST docker-1.13.1.tar.gz 7788075 SHA256 2730e7cc15492de8f1d6f9510c64620fc9004c8afc1410bf3ebac9fc3f9f83c6 SHA512 e480a884d7bb4f41f5c036afd5fae878e03aa740297dd3dd4df0eb8766efa6426ba636453513b423666eea21ba99f162ec27885828f8348d8746424944a3cfb4 WHIRLPOOL 8c0bfadf4102f6f41c182d8443276aa68ca1242d8321ce8fda639f0ad2162ae62d7310dbbb0967269d466207e54131b0a829bf6365f87fceb7114bbc1832dcfe
23 +DIST docker-17.03.0.tar.gz 7769578 SHA256 d8e91af5b2799cafac113a400d4db9c6abe01ae823f378d2f4d3d3e55e48eaf6 SHA512 042d94143f8867e8165e4c306188fc8e5801faaa9901716a509c5a9f380e460ab54b4c48ee223909c0bf9360ec023b765e6258acbe1f03e6513a8fc364663970 WHIRLPOOL 452ae7ea3329e3fe08ce76fba479502c5150218747c9d2a65495c9c4de1046ba9ac97be748535112022b665398bbb4581f8ae2bd6cb28d4462882055b15c9398
24
25 diff --git a/app-emulation/docker/docker-17.03.0.ebuild b/app-emulation/docker/docker-17.03.0.ebuild
26 new file mode 100644
27 index 00000000000..ec2cbbf9e9e
28 --- /dev/null
29 +++ b/app-emulation/docker/docker-17.03.0.ebuild
30 @@ -0,0 +1,292 @@
31 +# Copyright 1999-2017 Gentoo Foundation
32 +# Distributed under the terms of the GNU General Public License v2
33 +
34 +EAPI=6
35 +
36 +EGO_PN="github.com/docker/docker"
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 + MY_PV="${PV/_/-}"
45 + DOCKER_GITCOMMIT="092cba3"
46 + EGIT_COMMIT="v${MY_PV}-ce"
47 + SRC_URI="https://${EGO_PN}/archive/${EGIT_COMMIT}.tar.gz -> ${P}.tar.gz"
48 + KEYWORDS="~amd64"
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 +# Runc/Containerd: Unfortunately docker does not version the releases, in order to avoid
83 +# incompatiblities we depend on snapshots
84 +RDEPEND="
85 + ${CDEPEND}
86 +
87 + !app-emulation/docker-bin
88 + >=net-firewall/iptables-1.4
89 + sys-process/procps
90 + >=dev-vcs/git-1.7
91 + >=app-arch/xz-utils-4.9
92 +
93 + ~app-emulation/containerd-0.2.3_p20170131
94 + ~app-emulation/docker-runc-1.0.0_rc2_p20170222[apparmor?,seccomp?]
95 + app-emulation/docker-proxy
96 + container-init? ( >=sys-process/tini-0.13.0[static] )
97 +"
98 +
99 +RESTRICT="installsources strip"
100 +
101 +S="${WORKDIR}/${P}/src/${EGO_PN}"
102 +
103 +# see "contrib/check-config.sh" from upstream's sources
104 +CONFIG_CHECK="
105 + ~NAMESPACES ~NET_NS ~PID_NS ~IPC_NS ~UTS_NS
106 + ~CGROUPS ~CGROUP_CPUACCT ~CGROUP_DEVICE ~CGROUP_FREEZER ~CGROUP_SCHED ~CPUSETS ~MEMCG
107 + ~KEYS
108 + ~VETH ~BRIDGE ~BRIDGE_NETFILTER
109 + ~NF_NAT_IPV4 ~IP_NF_FILTER ~IP_NF_TARGET_MASQUERADE
110 + ~NETFILTER_XT_MATCH_ADDRTYPE ~NETFILTER_XT_MATCH_CONNTRACK
111 + ~NF_NAT ~NF_NAT_NEEDED
112 + ~POSIX_MQUEUE
113 +
114 + ~USER_NS
115 + ~SECCOMP
116 + ~CGROUP_PIDS
117 + ~MEMCG_SWAP ~MEMCG_SWAP_ENABLED
118 +
119 + ~BLK_CGROUP ~BLK_DEV_THROTTLING ~IOSCHED_CFQ ~CFQ_GROUP_IOSCHED
120 + ~CGROUP_PERF
121 + ~CGROUP_HUGETLB
122 + ~NET_CLS_CGROUP
123 + ~CFS_BANDWIDTH ~FAIR_GROUP_SCHED ~RT_GROUP_SCHED
124 + ~IP_VS ~IP_VS_PROTO_TCP ~IP_VS_PROTO_UDP ~IP_VS_NFCT
125 +
126 + ~VXLAN
127 + ~XFRM_ALGO ~XFRM_USER
128 + ~IPVLAN
129 + ~MACVLAN ~DUMMY
130 +"
131 +
132 +ERROR_KEYS="CONFIG_KEYS: is mandatory"
133 +ERROR_MEMCG_SWAP="CONFIG_MEMCG_SWAP: is required if you wish to limit swap usage of containers"
134 +ERROR_RESOURCE_COUNTERS="CONFIG_RESOURCE_COUNTERS: is optional for container statistics gathering"
135 +
136 +ERROR_BLK_CGROUP="CONFIG_BLK_CGROUP: is optional for container statistics gathering"
137 +ERROR_IOSCHED_CFQ="CONFIG_IOSCHED_CFQ: is optional for container statistics gathering"
138 +ERROR_CGROUP_PERF="CONFIG_CGROUP_PERF: is optional for container statistics gathering"
139 +ERROR_CFS_BANDWIDTH="CONFIG_CFS_BANDWIDTH: is optional for container statistics gathering"
140 +ERROR_XFRM_ALGO="CONFIG_XFRM_ALGO: is optional for secure networks"
141 +ERROR_XFRM_USER="CONFIG_XFRM_USER: is optional for secure networks"
142 +
143 +PATCHES=(
144 + "${FILESDIR}"/1.13.1-split-openrc-log.patch
145 +)
146 +
147 +pkg_setup() {
148 + if kernel_is lt 3 10; then
149 + ewarn ""
150 + ewarn "Using Docker with kernels older than 3.10 is unstable and unsupported."
151 + ewarn " - http://docs.docker.com/engine/installation/binaries/#check-kernel-dependencies"
152 + fi
153 +
154 + # for where these kernel versions come from, see:
155 + # https://www.google.com/search?q=945b2b2d259d1a4364a2799e80e8ff32f8c6ee6f+site%3Akernel.org%2Fpub%2Flinux%2Fkernel+file%3AChangeLog*
156 + if ! {
157 + kernel_is ge 3 16 \
158 + || { kernel_is 3 15 && kernel_is ge 3 15 5; } \
159 + || { kernel_is 3 14 && kernel_is ge 3 14 12; } \
160 + || { kernel_is 3 12 && kernel_is ge 3 12 25; }
161 + }; then
162 + ewarn ""
163 + ewarn "There is a serious Docker-related kernel panic that has been fixed in 3.16+"
164 + ewarn " (and was backported to 3.15.5+, 3.14.12+, and 3.12.25+)"
165 + ewarn ""
166 + ewarn "See also https://github.com/docker/docker/issues/2960"
167 + fi
168 +
169 + if kernel_is le 3 18; then
170 + CONFIG_CHECK+="
171 + ~RESOURCE_COUNTERS
172 + "
173 + fi
174 +
175 + if kernel_is le 3 13; then
176 + CONFIG_CHECK+="
177 + ~NETPRIO_CGROUP
178 + "
179 + else
180 + CONFIG_CHECK+="
181 + ~CGROUP_NET_PRIO
182 + "
183 + fi
184 +
185 + if kernel_is lt 4 5; then
186 + CONFIG_CHECK+="
187 + ~MEMCG_KMEM
188 + "
189 + ERROR_MEMCG_KMEM="CONFIG_MEMCG_KMEM: is optional"
190 + fi
191 +
192 + if kernel_is lt 4 7; then
193 + CONFIG_CHECK+="
194 + ~DEVPTS_MULTIPLE_INSTANCES
195 + "
196 + fi
197 +
198 + if use aufs; then
199 + CONFIG_CHECK+="
200 + ~AUFS_FS
201 + ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
202 + "
203 + ERROR_AUFS_FS="CONFIG_AUFS_FS: is required to be set if and only if aufs-sources are used instead of aufs4/aufs3"
204 + fi
205 +
206 + if use btrfs; then
207 + CONFIG_CHECK+="
208 + ~BTRFS_FS
209 + ~BTRFS_FS_POSIX_ACL
210 + "
211 + fi
212 +
213 + if use device-mapper; then
214 + CONFIG_CHECK+="
215 + ~BLK_DEV_DM ~DM_THIN_PROVISIONING ~EXT4_FS ~EXT4_FS_POSIX_ACL ~EXT4_FS_SECURITY
216 + "
217 + fi
218 +
219 + if use overlay; then
220 + CONFIG_CHECK+="
221 + ~OVERLAY_FS ~EXT4_FS_SECURITY ~EXT4_FS_POSIX_ACL
222 + "
223 + fi
224 +
225 + linux-info_pkg_setup
226 +
227 + # create docker group for the code checking for it in /etc/group
228 + enewgroup docker
229 +}
230 +
231 +src_compile() {
232 + export GOPATH="${WORKDIR}/${P}:${PWD}/vendor"
233 +
234 + # setup CFLAGS and LDFLAGS for separate build target
235 + # see https://github.com/tianon/docker-overlay/pull/10
236 + export CGO_CFLAGS="-I${ROOT}/usr/include"
237 + export CGO_LDFLAGS="-L${ROOT}/usr/$(get_libdir)"
238 +
239 + # if we're building from a tarball, we need the GITCOMMIT value
240 + [ "$DOCKER_GITCOMMIT" ] && export DOCKER_GITCOMMIT
241 +
242 + if use hardened; then
243 + sed -i "s/EXTLDFLAGS_STATIC='/&-fno-PIC /" hack/make.sh || die
244 + grep -q -- '-fno-PIC' hack/make.sh || die 'hardened sed failed'
245 +
246 + sed "s/LDFLAGS_STATIC_DOCKER='/&-extldflags -fno-PIC /" \
247 + -i hack/make/dynbinary-client || die
248 + sed "s/LDFLAGS_STATIC_DOCKER='/&-extldflags -fno-PIC /" \
249 + -i hack/make/dynbinary-daemon || die
250 + grep -q -- '-fno-PIC' hack/make/dynbinary-daemon || die 'hardened sed failed'
251 + grep -q -- '-fno-PIC' hack/make/dynbinary-client || die 'hardened sed failed'
252 + fi
253 +
254 + # let's set up some optional features :)
255 + export DOCKER_BUILDTAGS=''
256 + for gd in aufs btrfs device-mapper overlay; do
257 + if ! use $gd; then
258 + DOCKER_BUILDTAGS+=" exclude_graphdriver_${gd//-/}"
259 + fi
260 + done
261 +
262 + for tag in apparmor pkcs11 seccomp; do
263 + if use $tag; then
264 + DOCKER_BUILDTAGS+=" $tag"
265 + fi
266 + done
267 +
268 + # time to build!
269 + ./hack/make.sh dynbinary || die 'dynbinary failed'
270 +
271 + # build the man pages too
272 + ./man/md2man-all.sh || die "unable to generate man pages"
273 +}
274 +
275 +src_install() {
276 + VERSION="$(cat VERSION)"
277 + newbin "bundles/$VERSION/dynbinary-client/docker-$VERSION" docker
278 + newbin "bundles/$VERSION/dynbinary-daemon/dockerd-$VERSION" dockerd
279 + dosym containerd /usr/bin/docker-containerd
280 + dosym containerd-shim /usr/bin/docker-containerd-shim
281 + dosym runc /usr/bin/docker-runc
282 + use container-init && dosym tini /usr/bin/docker-init
283 +
284 + newinitd contrib/init/openrc/docker.initd docker
285 + newconfd contrib/init/openrc/docker.confd docker
286 +
287 + systemd_dounit contrib/init/systemd/docker.{service,socket}
288 +
289 + udev_dorules contrib/udev/*.rules
290 +
291 + dodoc AUTHORS CONTRIBUTING.md CHANGELOG.md NOTICE README.md
292 + dodoc -r docs/*
293 + doman man/man*/*
294 +
295 + dobashcomp contrib/completion/bash/*
296 +
297 + insinto /usr/share/zsh/site-functions
298 + doins contrib/completion/zsh/_*
299 +
300 + insinto /usr/share/vim/vimfiles
301 + doins -r contrib/syntax/vim/ftdetect
302 + doins -r contrib/syntax/vim/syntax
303 +
304 + # note: intentionally not using "doins" so that we preserve +x bits
305 + dodir /usr/share/${PN}/contrib
306 + cp -R contrib/* "${ED}/usr/share/${PN}/contrib"
307 +}
308 +
309 +pkg_postinst() {
310 + udev_reload
311 +
312 + elog
313 + elog "To use Docker, the Docker daemon must be running as root. To automatically"
314 + elog "start the Docker daemon at boot, add Docker to the default runlevel:"
315 + elog " rc-update add docker default"
316 + elog "Similarly for systemd:"
317 + elog " systemctl enable docker.service"
318 + elog
319 + elog "To use Docker as a non-root user, add yourself to the 'docker' group:"
320 + elog " usermod -aG docker youruser"
321 + elog
322 +}