diff options
author | Bruce Ashfield <bruce.ashfield@gmail.com> | 2019-03-21 10:47:46 -0400 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2019-03-21 10:47:46 -0400 |
commit | d19fda374317daab673ed1b78f68010c14eebf47 (patch) | |
tree | 80e7893092c970365e69fc516d93c4b4272b28ce | |
parent | 9e4957d36aff17e8c0b22e5499653572cc44adf3 (diff) | |
download | meta-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.bb | 55 | ||||
-rw-r--r-- | recipes-containers/docker/docker.inc | 56 | ||||
-rw-r--r-- | recipes-containers/docker/docker_git.bb | 57 |
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 | ||
29 | require docker.inc | ||
30 | |||
29 | # Apache-2.0 for docker | 31 | # Apache-2.0 for docker |
30 | LICENSE = "Apache-2.0" | 32 | LICENSE = "Apache-2.0" |
31 | LIC_FILES_CHKSUM = "file://src/import/components/engine/LICENSE;md5=9740d093a080530b5c5c6573df9af45a" | 33 | LIC_FILES_CHKSUM = "file://src/import/components/engine/LICENSE;md5=9740d093a080530b5c5c6573df9af45a" |
@@ -37,43 +39,10 @@ S = "${WORKDIR}/git" | |||
37 | DOCKER_VERSION = "18.09.3-ce" | 39 | DOCKER_VERSION = "18.09.3-ce" |
38 | PV = "${DOCKER_VERSION}+git${SRCREV_docker}" | 40 | PV = "${DOCKER_VERSION}+git${SRCREV_docker}" |
39 | 41 | ||
40 | DEPENDS = " \ | ||
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 | |||
62 | PACKAGES =+ "${PN}-contrib" | 42 | PACKAGES =+ "${PN}-contrib" |
63 | 43 | ||
64 | DEPENDS_append_class-target = " lvm2" | ||
65 | RDEPENDS_${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 | " | ||
71 | RDEPENDS_${PN} += "virtual/containerd virtual/runc" | ||
72 | |||
73 | RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat" | ||
74 | DOCKER_PKG="github.com/docker/docker" | 44 | DOCKER_PKG="github.com/docker/docker" |
75 | 45 | ||
76 | inherit systemd update-rc.d | ||
77 | inherit go | 46 | inherit go |
78 | inherit goarch | 47 | inherit goarch |
79 | inherit pkgconfig | 48 | inherit 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 | ||
129 | SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" | ||
130 | SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}" | ||
131 | SYSTEMD_AUTO_ENABLE_${PN} = "enable" | ||
132 | |||
133 | INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}" | ||
134 | INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}" | ||
135 | INITSCRIPT_PARAMS_${PN} = "defaults" | ||
136 | |||
137 | do_install() { | 98 | do_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 | ||
160 | inherit useradd | ||
161 | USERADD_PACKAGES = "${PN}" | ||
162 | GROUPADD_PARAM_${PN} = "-r docker" | ||
163 | |||
164 | FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker" | 121 | FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker" |
165 | 122 | ||
166 | FILES_${PN}-contrib += "${datadir}/docker/check-config.sh" | 123 | FILES_${PN}-contrib += "${datadir}/docker/check-config.sh" |
167 | RDEPENDS_${PN}-contrib += "bash" | 124 | RDEPENDS_${PN}-contrib += "bash" |
168 | |||
169 | # DO NOT STRIP docker | ||
170 | INHIBIT_PACKAGE_STRIP = "1" | ||
171 | INSANE_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 @@ | |||
1 | DEPENDS = " \ | ||
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 | |||
23 | DEPENDS_append_class-target = " lvm2" | ||
24 | RDEPENDS_${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 | " | ||
30 | RDEPENDS_${PN} += "virtual/containerd virtual/runc" | ||
31 | |||
32 | RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat" | ||
33 | |||
34 | inherit pkgconfig | ||
35 | PACKAGECONFIG ??= "" | ||
36 | PACKAGECONFIG[seccomp] = "seccomp,,libseccomp" | ||
37 | |||
38 | inherit systemd update-rc.d | ||
39 | |||
40 | SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" | ||
41 | SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}" | ||
42 | SYSTEMD_AUTO_ENABLE_${PN} = "enable" | ||
43 | |||
44 | INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}" | ||
45 | INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}" | ||
46 | INITSCRIPT_PARAMS_${PN} = "defaults" | ||
47 | |||
48 | inherit useradd | ||
49 | USERADD_PACKAGES = "${PN}" | ||
50 | GROUPADD_PARAM_${PN} = "-r docker" | ||
51 | |||
52 | COMPATIBLE_HOST = "^(?!(qemu)?mips).*" | ||
53 | |||
54 | # DO NOT STRIP docker | ||
55 | INHIBIT_PACKAGE_STRIP = "1" | ||
56 | INSANE_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 | ||
49 | require docker.inc | ||
50 | |||
49 | # Apache-2.0 for docker | 51 | # Apache-2.0 for docker |
50 | LICENSE = "Apache-2.0" | 52 | LICENSE = "Apache-2.0" |
51 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28" | 53 | LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28" |
@@ -57,48 +59,12 @@ S = "${WORKDIR}/git" | |||
57 | DOCKER_VERSION = "18.09.3" | 59 | DOCKER_VERSION = "18.09.3" |
58 | PV = "${DOCKER_VERSION}+git${SRCREV_moby}" | 60 | PV = "${DOCKER_VERSION}+git${SRCREV_moby}" |
59 | 61 | ||
60 | DEPENDS = " \ | ||
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 | |||
81 | PACKAGECONFIG ??= "" | ||
82 | PACKAGECONFIG[seccomp] = "seccomp,,libseccomp" | ||
83 | |||
84 | PACKAGES =+ "${PN}-contrib" | 62 | PACKAGES =+ "${PN}-contrib" |
85 | 63 | ||
86 | DEPENDS_append_class-target = " lvm2" | ||
87 | RDEPENDS_${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 | " | ||
93 | RDEPENDS_${PN} += "virtual/containerd virtual/runc" | ||
94 | |||
95 | RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat docker-init" | ||
96 | DOCKER_PKG="github.com/docker/docker" | 64 | DOCKER_PKG="github.com/docker/docker" |
97 | 65 | ||
98 | inherit systemd update-rc.d | ||
99 | inherit go | 66 | inherit go |
100 | inherit goarch | 67 | inherit goarch |
101 | inherit pkgconfig | ||
102 | 68 | ||
103 | do_configure[noexec] = "1" | 69 | do_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 | ||
151 | SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}" | ||
152 | SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}" | ||
153 | |||
154 | SYSTEMD_AUTO_ENABLE_${PN} = "enable" | ||
155 | |||
156 | INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}" | ||
157 | INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}" | ||
158 | INITSCRIPT_PARAMS_${PN} = "defaults" | ||
159 | |||
160 | do_install() { | 117 | do_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 | ||
183 | inherit useradd | ||
184 | USERADD_PACKAGES = "${PN}" | ||
185 | GROUPADD_PARAM_${PN} = "-r docker" | ||
186 | |||
187 | FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker" | 140 | FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker" |
188 | 141 | ||
189 | FILES_${PN}-contrib += "${datadir}/docker/check-config.sh" | 142 | FILES_${PN}-contrib += "${datadir}/docker/check-config.sh" |
190 | RDEPENDS_${PN}-contrib += "bash" | 143 | RDEPENDS_${PN}-contrib += "bash" |
191 | |||
192 | # DO NOT STRIP docker | ||
193 | INHIBIT_PACKAGE_STRIP = "1" | ||
194 | INSANE_SKIP_${PN} += "ldflags textrel" | ||
195 | |||
196 | COMPATIBLE_HOST = "^(?!(qemu)?mips).*" | ||