mirror of
git://git.yoctoproject.org/meta-virtualization.git
synced 2025-07-06 13:55:24 +02:00
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>
This commit is contained in:
parent
9e4957d36a
commit
d19fda3743
|
@ -9,8 +9,8 @@ DESCRIPTION = "Linux container runtime \
|
||||||
large-scale web deployments, database clusters, continuous deployment \
|
large-scale web deployments, database clusters, continuous deployment \
|
||||||
systems, private PaaS, service-oriented architectures, etc. \
|
systems, private PaaS, service-oriented architectures, etc. \
|
||||||
. \
|
. \
|
||||||
This package contains the daemon and client. Using docker.io is \
|
This package contains the daemon and client, which are \
|
||||||
officially supported on x86_64 and arm (32-bit) hosts. \
|
officially supported on x86_64 and arm hosts. \
|
||||||
Other architectures are considered experimental. \
|
Other architectures are considered experimental. \
|
||||||
. \
|
. \
|
||||||
Also, note that kernel version 3.10 or above is required for proper \
|
Also, note that kernel version 3.10 or above is required for proper \
|
||||||
|
@ -26,6 +26,8 @@ SRC_URI = "\
|
||||||
file://docker.init \
|
file://docker.init \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
require docker.inc
|
||||||
|
|
||||||
# Apache-2.0 for docker
|
# Apache-2.0 for docker
|
||||||
LICENSE = "Apache-2.0"
|
LICENSE = "Apache-2.0"
|
||||||
LIC_FILES_CHKSUM = "file://src/import/components/engine/LICENSE;md5=9740d093a080530b5c5c6573df9af45a"
|
LIC_FILES_CHKSUM = "file://src/import/components/engine/LICENSE;md5=9740d093a080530b5c5c6573df9af45a"
|
||||||
|
@ -37,43 +39,10 @@ S = "${WORKDIR}/git"
|
||||||
DOCKER_VERSION = "18.09.3-ce"
|
DOCKER_VERSION = "18.09.3-ce"
|
||||||
PV = "${DOCKER_VERSION}+git${SRCREV_docker}"
|
PV = "${DOCKER_VERSION}+git${SRCREV_docker}"
|
||||||
|
|
||||||
DEPENDS = " \
|
|
||||||
go-cli \
|
|
||||||
go-pty \
|
|
||||||
go-context \
|
|
||||||
go-mux \
|
|
||||||
go-patricia \
|
|
||||||
go-logrus \
|
|
||||||
go-fsnotify \
|
|
||||||
go-dbus \
|
|
||||||
go-capability \
|
|
||||||
go-systemd \
|
|
||||||
btrfs-tools \
|
|
||||||
sqlite3 \
|
|
||||||
go-distribution \
|
|
||||||
compose-file \
|
|
||||||
go-connections \
|
|
||||||
notary \
|
|
||||||
grpc-go \
|
|
||||||
libtool-native \
|
|
||||||
libtool \
|
|
||||||
"
|
|
||||||
|
|
||||||
PACKAGES =+ "${PN}-contrib"
|
PACKAGES =+ "${PN}-contrib"
|
||||||
|
|
||||||
DEPENDS_append_class-target = " lvm2"
|
|
||||||
RDEPENDS_${PN} = "util-linux util-linux-unshare iptables \
|
|
||||||
${@bb.utils.contains('DISTRO_FEATURES', 'aufs', 'aufs-util', '', d)} \
|
|
||||||
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'cgroup-lite', d)} \
|
|
||||||
bridge-utils \
|
|
||||||
ca-certificates \
|
|
||||||
"
|
|
||||||
RDEPENDS_${PN} += "virtual/containerd virtual/runc"
|
|
||||||
|
|
||||||
RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat"
|
|
||||||
DOCKER_PKG="github.com/docker/docker"
|
DOCKER_PKG="github.com/docker/docker"
|
||||||
|
|
||||||
inherit systemd update-rc.d
|
|
||||||
inherit go
|
inherit go
|
||||||
inherit goarch
|
inherit goarch
|
||||||
inherit pkgconfig
|
inherit pkgconfig
|
||||||
|
@ -126,14 +95,6 @@ do_compile() {
|
||||||
VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" make dynbinary
|
VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" make dynbinary
|
||||||
}
|
}
|
||||||
|
|
||||||
SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
|
|
||||||
SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}"
|
|
||||||
SYSTEMD_AUTO_ENABLE_${PN} = "enable"
|
|
||||||
|
|
||||||
INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}"
|
|
||||||
INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}"
|
|
||||||
INITSCRIPT_PARAMS_${PN} = "defaults"
|
|
||||||
|
|
||||||
do_install() {
|
do_install() {
|
||||||
mkdir -p ${D}/${bindir}
|
mkdir -p ${D}/${bindir}
|
||||||
cp ${S}/src/import/components/cli/build/docker ${D}/${bindir}/docker
|
cp ${S}/src/import/components/cli/build/docker ${D}/${bindir}/docker
|
||||||
|
@ -157,15 +118,7 @@ do_install() {
|
||||||
install -m 0755 ${S}/src/import/components/engine/contrib/check-config.sh ${D}${datadir}/docker/
|
install -m 0755 ${S}/src/import/components/engine/contrib/check-config.sh ${D}${datadir}/docker/
|
||||||
}
|
}
|
||||||
|
|
||||||
inherit useradd
|
|
||||||
USERADD_PACKAGES = "${PN}"
|
|
||||||
GROUPADD_PARAM_${PN} = "-r docker"
|
|
||||||
|
|
||||||
FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker"
|
FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker"
|
||||||
|
|
||||||
FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
|
FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
|
||||||
RDEPENDS_${PN}-contrib += "bash"
|
RDEPENDS_${PN}-contrib += "bash"
|
||||||
|
|
||||||
# DO NOT STRIP docker
|
|
||||||
INHIBIT_PACKAGE_STRIP = "1"
|
|
||||||
INSANE_SKIP_${PN} += "ldflags"
|
|
||||||
|
|
56
recipes-containers/docker/docker.inc
Normal file
56
recipes-containers/docker/docker.inc
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
DEPENDS = " \
|
||||||
|
go-cli \
|
||||||
|
go-pty \
|
||||||
|
go-context \
|
||||||
|
go-mux \
|
||||||
|
go-patricia \
|
||||||
|
go-logrus \
|
||||||
|
go-fsnotify \
|
||||||
|
go-dbus \
|
||||||
|
go-capability \
|
||||||
|
go-systemd \
|
||||||
|
btrfs-tools \
|
||||||
|
sqlite3 \
|
||||||
|
go-distribution \
|
||||||
|
compose-file \
|
||||||
|
go-connections \
|
||||||
|
notary \
|
||||||
|
grpc-go \
|
||||||
|
libtool-native \
|
||||||
|
libtool \
|
||||||
|
"
|
||||||
|
|
||||||
|
DEPENDS_append_class-target = " lvm2"
|
||||||
|
RDEPENDS_${PN} = "util-linux util-linux-unshare iptables \
|
||||||
|
${@bb.utils.contains('DISTRO_FEATURES', 'aufs', 'aufs-util', '', d)} \
|
||||||
|
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'cgroup-lite', d)} \
|
||||||
|
bridge-utils \
|
||||||
|
ca-certificates \
|
||||||
|
"
|
||||||
|
RDEPENDS_${PN} += "virtual/containerd virtual/runc"
|
||||||
|
|
||||||
|
RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat"
|
||||||
|
|
||||||
|
inherit pkgconfig
|
||||||
|
PACKAGECONFIG ??= ""
|
||||||
|
PACKAGECONFIG[seccomp] = "seccomp,,libseccomp"
|
||||||
|
|
||||||
|
inherit systemd update-rc.d
|
||||||
|
|
||||||
|
SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
|
||||||
|
SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}"
|
||||||
|
SYSTEMD_AUTO_ENABLE_${PN} = "enable"
|
||||||
|
|
||||||
|
INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}"
|
||||||
|
INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}"
|
||||||
|
INITSCRIPT_PARAMS_${PN} = "defaults"
|
||||||
|
|
||||||
|
inherit useradd
|
||||||
|
USERADD_PACKAGES = "${PN}"
|
||||||
|
GROUPADD_PARAM_${PN} = "-r docker"
|
||||||
|
|
||||||
|
COMPATIBLE_HOST = "^(?!(qemu)?mips).*"
|
||||||
|
|
||||||
|
# DO NOT STRIP docker
|
||||||
|
INHIBIT_PACKAGE_STRIP = "1"
|
||||||
|
INSANE_SKIP_${PN} += "ldflags textrel"
|
|
@ -46,6 +46,8 @@ SRC_URI = "\
|
||||||
file://0001-libnetwork-use-GO-instead-of-go.patch \
|
file://0001-libnetwork-use-GO-instead-of-go.patch \
|
||||||
"
|
"
|
||||||
|
|
||||||
|
require docker.inc
|
||||||
|
|
||||||
# Apache-2.0 for docker
|
# Apache-2.0 for docker
|
||||||
LICENSE = "Apache-2.0"
|
LICENSE = "Apache-2.0"
|
||||||
LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28"
|
LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28"
|
||||||
|
@ -57,48 +59,12 @@ S = "${WORKDIR}/git"
|
||||||
DOCKER_VERSION = "18.09.3"
|
DOCKER_VERSION = "18.09.3"
|
||||||
PV = "${DOCKER_VERSION}+git${SRCREV_moby}"
|
PV = "${DOCKER_VERSION}+git${SRCREV_moby}"
|
||||||
|
|
||||||
DEPENDS = " \
|
|
||||||
go-cli \
|
|
||||||
go-pty \
|
|
||||||
go-context \
|
|
||||||
go-mux \
|
|
||||||
go-patricia \
|
|
||||||
go-logrus \
|
|
||||||
go-fsnotify \
|
|
||||||
go-dbus \
|
|
||||||
go-capability \
|
|
||||||
go-systemd \
|
|
||||||
btrfs-tools \
|
|
||||||
sqlite3 \
|
|
||||||
go-distribution \
|
|
||||||
compose-file \
|
|
||||||
go-connections \
|
|
||||||
notary \
|
|
||||||
grpc-go \
|
|
||||||
libtool \
|
|
||||||
"
|
|
||||||
|
|
||||||
PACKAGECONFIG ??= ""
|
|
||||||
PACKAGECONFIG[seccomp] = "seccomp,,libseccomp"
|
|
||||||
|
|
||||||
PACKAGES =+ "${PN}-contrib"
|
PACKAGES =+ "${PN}-contrib"
|
||||||
|
|
||||||
DEPENDS_append_class-target = " lvm2"
|
|
||||||
RDEPENDS_${PN} = "util-linux util-linux-unshare iptables \
|
|
||||||
${@bb.utils.contains('DISTRO_FEATURES', 'aufs', 'aufs-util', '', d)} \
|
|
||||||
${@bb.utils.contains('DISTRO_FEATURES', 'systemd', '', 'cgroup-lite', d)} \
|
|
||||||
bridge-utils \
|
|
||||||
ca-certificates \
|
|
||||||
"
|
|
||||||
RDEPENDS_${PN} += "virtual/containerd virtual/runc"
|
|
||||||
|
|
||||||
RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat docker-init"
|
|
||||||
DOCKER_PKG="github.com/docker/docker"
|
DOCKER_PKG="github.com/docker/docker"
|
||||||
|
|
||||||
inherit systemd update-rc.d
|
|
||||||
inherit go
|
inherit go
|
||||||
inherit goarch
|
inherit goarch
|
||||||
inherit pkgconfig
|
|
||||||
|
|
||||||
do_configure[noexec] = "1"
|
do_configure[noexec] = "1"
|
||||||
|
|
||||||
|
@ -148,15 +114,6 @@ do_compile() {
|
||||||
oe_runmake cross-local
|
oe_runmake cross-local
|
||||||
}
|
}
|
||||||
|
|
||||||
SYSTEMD_PACKAGES = "${@bb.utils.contains('DISTRO_FEATURES','systemd','${PN}','',d)}"
|
|
||||||
SYSTEMD_SERVICE_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','systemd','docker.service','',d)}"
|
|
||||||
|
|
||||||
SYSTEMD_AUTO_ENABLE_${PN} = "enable"
|
|
||||||
|
|
||||||
INITSCRIPT_PACKAGES += "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','${PN}','',d)}"
|
|
||||||
INITSCRIPT_NAME_${PN} = "${@bb.utils.contains('DISTRO_FEATURES','sysvinit','docker.init','',d)}"
|
|
||||||
INITSCRIPT_PARAMS_${PN} = "defaults"
|
|
||||||
|
|
||||||
do_install() {
|
do_install() {
|
||||||
mkdir -p ${D}/${bindir}
|
mkdir -p ${D}/${bindir}
|
||||||
cp ${WORKDIR}/git/cli/build/docker ${D}/${bindir}/docker
|
cp ${WORKDIR}/git/cli/build/docker ${D}/${bindir}/docker
|
||||||
|
@ -180,17 +137,7 @@ do_install() {
|
||||||
install -m 0755 ${S}/src/import/contrib/check-config.sh ${D}${datadir}/docker/
|
install -m 0755 ${S}/src/import/contrib/check-config.sh ${D}${datadir}/docker/
|
||||||
}
|
}
|
||||||
|
|
||||||
inherit useradd
|
|
||||||
USERADD_PACKAGES = "${PN}"
|
|
||||||
GROUPADD_PARAM_${PN} = "-r docker"
|
|
||||||
|
|
||||||
FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker"
|
FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker"
|
||||||
|
|
||||||
FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
|
FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
|
||||||
RDEPENDS_${PN}-contrib += "bash"
|
RDEPENDS_${PN}-contrib += "bash"
|
||||||
|
|
||||||
# DO NOT STRIP docker
|
|
||||||
INHIBIT_PACKAGE_STRIP = "1"
|
|
||||||
INSANE_SKIP_${PN} += "ldflags textrel"
|
|
||||||
|
|
||||||
COMPATIBLE_HOST = "^(?!(qemu)?mips).*"
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user