summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@gmail.com>2019-03-21 10:47:46 -0400
committerBruce Ashfield <bruce.ashfield@gmail.com>2019-03-21 10:47:46 -0400
commitd19fda374317daab673ed1b78f68010c14eebf47 (patch)
tree80e7893092c970365e69fc516d93c4b4272b28ce
parent9e4957d36aff17e8c0b22e5499653572cc44adf3 (diff)
downloadmeta-virtualization-d19fda374317daab673ed1b78f68010c14eebf47.tar.gz
docker: consolidate common depends/options
The split between docker-ce and docker (moby) was initially quite different, and docker-ce was more of a reference versus a supported / working package. Upstream has evolved such that both are valid options, and may be chosen due to different requirements. Rather than duplicating all the settings, we can move the dependencies, init, rdepends, users, etc, into a .inc file and share them. For now, we keep the build separate, since depending on the uprev status, they still can require different build options and packaging. Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
-rw-r--r--recipes-containers/docker/docker-ce_git.bb55
-rw-r--r--recipes-containers/docker/docker.inc56
-rw-r--r--recipes-containers/docker/docker_git.bb57
3 files changed, 62 insertions, 106 deletions
diff --git a/recipes-containers/docker/docker-ce_git.bb b/recipes-containers/docker/docker-ce_git.bb
index a0d774ad..042d3a41 100644
--- a/recipes-containers/docker/docker-ce_git.bb
+++ b/recipes-containers/docker/docker-ce_git.bb
@@ -9,8 +9,8 @@ DESCRIPTION = "Linux container runtime \
9 large-scale web deployments, database clusters, continuous deployment \ 9 large-scale web deployments, database clusters, continuous deployment \
10 systems, private PaaS, service-oriented architectures, etc. \ 10 systems, private PaaS, service-oriented architectures, etc. \
11 . \ 11 . \
12 This package contains the daemon and client. Using docker.io is \ 12 This package contains the daemon and client, which are \
13 officially supported on x86_64 and arm (32-bit) hosts. \ 13 officially supported on x86_64 and arm hosts. \
14 Other architectures are considered experimental. \ 14 Other architectures are considered experimental. \
15 . \ 15 . \
16 Also, note that kernel version 3.10 or above is required for proper \ 16 Also, note that kernel version 3.10 or above is required for proper \
@@ -26,6 +26,8 @@ SRC_URI = "\
26 file://docker.init \ 26 file://docker.init \
27 " 27 "
28 28
29require docker.inc
30
29# Apache-2.0 for docker 31# Apache-2.0 for docker
30LICENSE = "Apache-2.0" 32LICENSE = "Apache-2.0"
31LIC_FILES_CHKSUM = "file://src/import/components/engine/LICENSE;md5=9740d093a080530b5c5c6573df9af45a" 33LIC_FILES_CHKSUM = "file://src/import/components/engine/LICENSE;md5=9740d093a080530b5c5c6573df9af45a"
@@ -37,43 +39,10 @@ S = "${WORKDIR}/git"
37DOCKER_VERSION = "18.09.3-ce" 39DOCKER_VERSION = "18.09.3-ce"
38PV = "${DOCKER_VERSION}+git${SRCREV_docker}" 40PV = "${DOCKER_VERSION}+git${SRCREV_docker}"
39 41
40DEPENDS = " \
41 go-cli \
42 go-pty \
43 go-context \
44 go-mux \
45 go-patricia \
46 go-logrus \
47 go-fsnotify \
48 go-dbus \
49 go-capability \
50 go-systemd \
51 btrfs-tools \
52 sqlite3 \
53 go-distribution \
54 compose-file \
55 go-connections \
56 notary \
57 grpc-go \
58 libtool-native \
59 libtool \
60 "
61
62PACKAGES =+ "${PN}-contrib" 42PACKAGES =+ "${PN}-contrib"
63 43
64DEPENDS_append_class-target = " lvm2"
65RDEPENDS_${PN} = "util-linux util-linux-unshare iptables \
66 ${@bb.utils.contains('DISTRO_FEATURES', 'aufs', 'aufs-util', '', d)} \
67 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'cgroup-lite', d)} \
68 bridge-utils \
69 ca-certificates \
70 "
71RDEPENDS_${PN} += "virtual/containerd virtual/runc"
72
73RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat"
74DOCKER_PKG="github.com/docker/docker" 44DOCKER_PKG="github.com/docker/docker"
75 45
76inherit systemd update-rc.d
77inherit go 46inherit go
78inherit goarch 47inherit goarch
79inherit pkgconfig 48inherit pkgconfig
@@ -126,14 +95,6 @@ do_compile() {
126 VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" make dynbinary 95 VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" make dynbinary
127} 96}
128 97
129SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
130SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}"
131SYSTEMD_AUTO_ENABLE_${PN} = "enable"
132
133INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}"
134INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}"
135INITSCRIPT_PARAMS_${PN} = "defaults"
136
137do_install() { 98do_install() {
138 mkdir -p ${D}/${bindir} 99 mkdir -p ${D}/${bindir}
139 cp ${S}/src/import/components/cli/build/docker ${D}/${bindir}/docker 100 cp ${S}/src/import/components/cli/build/docker ${D}/${bindir}/docker
@@ -157,15 +118,7 @@ do_install() {
157 install -m 0755 ${S}/src/import/components/engine/contrib/check-config.sh ${D}${datadir}/docker/ 118 install -m 0755 ${S}/src/import/components/engine/contrib/check-config.sh ${D}${datadir}/docker/
158} 119}
159 120
160inherit useradd
161USERADD_PACKAGES = "${PN}"
162GROUPADD_PARAM_${PN} = "-r docker"
163
164FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker" 121FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker"
165 122
166FILES_${PN}-contrib += "${datadir}/docker/check-config.sh" 123FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
167RDEPENDS_${PN}-contrib += "bash" 124RDEPENDS_${PN}-contrib += "bash"
168
169# DO NOT STRIP docker
170INHIBIT_PACKAGE_STRIP = "1"
171INSANE_SKIP_${PN} += "ldflags"
diff --git a/recipes-containers/docker/docker.inc b/recipes-containers/docker/docker.inc
new file mode 100644
index 00000000..168d2965
--- /dev/null
+++ b/recipes-containers/docker/docker.inc
@@ -0,0 +1,56 @@
1DEPENDS = " \
2 go-cli \
3 go-pty \
4 go-context \
5 go-mux \
6 go-patricia \
7 go-logrus \
8 go-fsnotify \
9 go-dbus \
10 go-capability \
11 go-systemd \
12 btrfs-tools \
13 sqlite3 \
14 go-distribution \
15 compose-file \
16 go-connections \
17 notary \
18 grpc-go \
19 libtool-native \
20 libtool \
21 "
22
23DEPENDS_append_class-target = " lvm2"
24RDEPENDS_${PN} = "util-linux util-linux-unshare iptables \
25 ${@bb.utils.contains('DISTRO_FEATURES', 'aufs', 'aufs-util', '', d)} \
26 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'cgroup-lite', d)} \
27 bridge-utils \
28 ca-certificates \
29 "
30RDEPENDS_${PN} += "virtual/containerd virtual/runc"
31
32RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat"
33
34inherit pkgconfig
35PACKAGECONFIG ??= ""
36PACKAGECONFIG[seccomp] = "seccomp,,libseccomp"
37
38inherit systemd update-rc.d
39
40SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
41SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}"
42SYSTEMD_AUTO_ENABLE_${PN} = "enable"
43
44INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}"
45INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}"
46INITSCRIPT_PARAMS_${PN} = "defaults"
47
48inherit useradd
49USERADD_PACKAGES = "${PN}"
50GROUPADD_PARAM_${PN} = "-r docker"
51
52COMPATIBLE_HOST = "^(?!(qemu)?mips).*"
53
54# DO NOT STRIP docker
55INHIBIT_PACKAGE_STRIP = "1"
56INSANE_SKIP_${PN} += "ldflags textrel"
diff --git a/recipes-containers/docker/docker_git.bb b/recipes-containers/docker/docker_git.bb
index d3c507ba..75a8161b 100644
--- a/recipes-containers/docker/docker_git.bb
+++ b/recipes-containers/docker/docker_git.bb
@@ -46,6 +46,8 @@ SRC_URI = "\
46 file://0001-libnetwork-use-GO-instead-of-go.patch \ 46 file://0001-libnetwork-use-GO-instead-of-go.patch \
47 " 47 "
48 48
49require docker.inc
50
49# Apache-2.0 for docker 51# Apache-2.0 for docker
50LICENSE = "Apache-2.0" 52LICENSE = "Apache-2.0"
51LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28" 53LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28"
@@ -57,48 +59,12 @@ S = "${WORKDIR}/git"
57DOCKER_VERSION = "18.09.3" 59DOCKER_VERSION = "18.09.3"
58PV = "${DOCKER_VERSION}+git${SRCREV_moby}" 60PV = "${DOCKER_VERSION}+git${SRCREV_moby}"
59 61
60DEPENDS = " \
61 go-cli \
62 go-pty \
63 go-context \
64 go-mux \
65 go-patricia \
66 go-logrus \
67 go-fsnotify \
68 go-dbus \
69 go-capability \
70 go-systemd \
71 btrfs-tools \
72 sqlite3 \
73 go-distribution \
74 compose-file \
75 go-connections \
76 notary \
77 grpc-go \
78 libtool \
79 "
80
81PACKAGECONFIG ??= ""
82PACKAGECONFIG[seccomp] = "seccomp,,libseccomp"
83
84PACKAGES =+ "${PN}-contrib" 62PACKAGES =+ "${PN}-contrib"
85 63
86DEPENDS_append_class-target = " lvm2"
87RDEPENDS_${PN} = "util-linux util-linux-unshare iptables \
88 ${@bb.utils.contains('DISTRO_FEATURES', 'aufs', 'aufs-util', '', d)} \
89 ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'cgroup-lite', d)} \
90 bridge-utils \
91 ca-certificates \
92 "
93RDEPENDS_${PN} += "virtual/containerd virtual/runc"
94
95RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat docker-init"
96DOCKER_PKG="github.com/docker/docker" 64DOCKER_PKG="github.com/docker/docker"
97 65
98inherit systemd update-rc.d
99inherit go 66inherit go
100inherit goarch 67inherit goarch
101inherit pkgconfig
102 68
103do_configure[noexec] = "1" 69do_configure[noexec] = "1"
104 70
@@ -148,15 +114,6 @@ do_compile() {
148 oe_runmake cross-local 114 oe_runmake cross-local
149} 115}
150 116
151SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
152SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}"
153
154SYSTEMD_AUTO_ENABLE_${PN} = "enable"
155
156INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}"
157INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}"
158INITSCRIPT_PARAMS_${PN} = "defaults"
159
160do_install() { 117do_install() {
161 mkdir -p ${D}/${bindir} 118 mkdir -p ${D}/${bindir}
162 cp ${WORKDIR}/git/cli/build/docker ${D}/${bindir}/docker 119 cp ${WORKDIR}/git/cli/build/docker ${D}/${bindir}/docker
@@ -180,17 +137,7 @@ do_install() {
180 install -m 0755 ${S}/src/import/contrib/check-config.sh ${D}${datadir}/docker/ 137 install -m 0755 ${S}/src/import/contrib/check-config.sh ${D}${datadir}/docker/
181} 138}
182 139
183inherit useradd
184USERADD_PACKAGES = "${PN}"
185GROUPADD_PARAM_${PN} = "-r docker"
186
187FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker" 140FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker"
188 141
189FILES_${PN}-contrib += "${datadir}/docker/check-config.sh" 142FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
190RDEPENDS_${PN}-contrib += "bash" 143RDEPENDS_${PN}-contrib += "bash"
191
192# DO NOT STRIP docker
193INHIBIT_PACKAGE_STRIP = "1"
194INSANE_SKIP_${PN} += "ldflags textrel"
195
196COMPATIBLE_HOST = "^(?!(qemu)?mips).*"