summaryrefslogtreecommitdiffstats
path: root/external/meta-virtualization/recipes-containers/docker
diff options
context:
space:
mode:
authortakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
committertakeshi_hoshina <takeshi_hoshina@mail.toyota.co.jp>2020-11-02 11:07:33 +0900
commit1c7d6584a7811b7785ae5c1e378f14b5ba0971cf (patch)
treecd70a267a5ef105ba32f200aa088e281fbd85747 /external/meta-virtualization/recipes-containers/docker
parent4204309872da5cb401cbb2729d9e2d4869a87f42 (diff)
recipes
Diffstat (limited to 'external/meta-virtualization/recipes-containers/docker')
-rw-r--r--external/meta-virtualization/recipes-containers/docker/docker-ce_git.bb94
-rw-r--r--external/meta-virtualization/recipes-containers/docker/docker-moby.bb (renamed from external/meta-virtualization/recipes-containers/docker/docker_git.bb)115
-rw-r--r--external/meta-virtualization/recipes-containers/docker/docker-moby/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch61
-rw-r--r--external/meta-virtualization/recipes-containers/docker/docker.inc65
-rw-r--r--external/meta-virtualization/recipes-containers/docker/files/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch61
-rw-r--r--external/meta-virtualization/recipes-containers/docker/files/docker.init4
6 files changed, 264 insertions, 136 deletions
diff --git a/external/meta-virtualization/recipes-containers/docker/docker-ce_git.bb b/external/meta-virtualization/recipes-containers/docker/docker-ce_git.bb
index caf6d704..14182d12 100644
--- a/external/meta-virtualization/recipes-containers/docker/docker-ce_git.bb
+++ b/external/meta-virtualization/recipes-containers/docker/docker-ce_git.bb
@@ -9,8 +9,8 @@ DESCRIPTION = "Linux container runtime \
large-scale web deployments, database clusters, continuous deployment \
systems, private PaaS, service-oriented architectures, etc. \
. \
- This package contains the daemon and client. Using docker.io is \
- officially supported on x86_64 and arm (32-bit) hosts. \
+ This package contains the daemon and client, which are \
+ officially supported on x86_64 and arm hosts. \
Other architectures are considered experimental. \
. \
Also, note that kernel version 3.10 or above is required for proper \
@@ -18,61 +18,35 @@ DESCRIPTION = "Linux container runtime \
subtle and/or glaring issues. \
"
-SRCREV_docker = "6e632f7fc395d15bce46f426086e91c01598cf59"
-SRCREV_libnetwork = "6da50d1978302f04c3e2089e29112ea24812f05b"
+SRCREV_docker = "afacb8b7f0d8d4f9d2a8e8736e9c993e672b41f3"
+SRCREV_libnetwork = "c7bae399e46fd620b8a006174b7327e4e6e647fd"
SRC_URI = "\
- git://github.com/docker/docker-ce.git;branch=18.09;name=docker \
- git://github.com/docker/libnetwork.git;branch=bump_18.09;name=libnetwork;destsuffix=git/libnetwork \
+ git://github.com/docker/docker-ce.git;branch=19.03;name=docker \
+ git://github.com/docker/libnetwork.git;branch=bump_19.03;name=libnetwork;destsuffix=git/libnetwork \
+ file://0001-libnetwork-use-GO-instead-of-go.patch \
file://docker.init \
+ file://0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch \
"
+require docker.inc
+
# Apache-2.0 for docker
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=4859e97a9c7780e77972d989f0823f28"
GO_IMPORT = "import"
S = "${WORKDIR}/git"
-DOCKER_VERSION = "18.09.0-ce"
+DOCKER_VERSION = "19.03.8-ce"
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"
-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)} \
- "
-RDEPENDS_${PN} += "virtual/containerd virtual/runc"
-
-RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat"
-RSUGGESTS_${PN} = "lxc rt-tests"
DOCKER_PKG="github.com/docker/docker"
+# in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056
+BUILD_TAGS = "exclude_graphdriver_btrfs exclude_graphdriver_devicemapper"
-inherit systemd update-rc.d
inherit go
inherit goarch
inherit pkgconfig
@@ -88,8 +62,6 @@ do_compile() {
mkdir -p .gopath/src/"$(dirname "${DOCKER_PKG}")"
ln -sf ../../../../components/engine/ .gopath/src/"${DOCKER_PKG}"
- mkdir -p .gopath/src/github.com/docker
- ln -sf ${WORKDIR}/git/libnetwork .gopath/src/github.com/docker/libnetwork
ln -sf ${S}/src/import/components/cli .gopath/src/github.com/docker/cli
export GOPATH="${S}/src/import/.gopath:${S}/src/import/vendor:${STAGING_DIR_TARGET}/${prefix}/local/go"
@@ -101,19 +73,19 @@ do_compile() {
export CGO_ENABLED="1"
export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
- # in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056
- export DOCKER_BUILDTAGS='exclude_graphdriver_btrfs exclude_graphdriver_devicemapper'
+ export DOCKER_BUILDTAGS='${BUILD_TAGS} ${PACKAGECONFIG_CONFARGS}'
export DISABLE_WARN_OUTSIDE_CONTAINER=1
cd ${S}/src/import/components/engine
- # this is the unsupported build structure
- # that doesn't rely on an existing docker
- # to build this:
+ # this is the unsupported build structure that doesn't rely on an
+ # existing docker to build this:
VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" ./hack/make.sh dynbinary
# build the proxy
+ cd ${S}/src/import
+ ln -sf ${WORKDIR}/git/libnetwork .gopath/src/github.com/docker/libnetwork
cd ${S}/src/import/.gopath/src/github.com/docker/libnetwork
oe_runmake cross-local
@@ -125,18 +97,10 @@ do_compile() {
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() {
mkdir -p ${D}/${bindir}
cp ${S}/src/import/components/cli/build/docker ${D}/${bindir}/docker
- cp ${S}/src/import/components/engine/bundles/latest/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd
+ cp ${S}/src/import/components/engine/bundles/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd
cp ${WORKDIR}/git/libnetwork/bin/docker-proxy* ${D}/${bindir}/docker-proxy
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
@@ -144,24 +108,24 @@ do_install() {
install -m 644 ${S}/src/import/components/engine/contrib/init/systemd/docker.* ${D}/${systemd_unitdir}/system
# replaces one copied from above with one that uses the local registry for a mirror
install -m 644 ${S}/src/import/components/engine/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system
+ rm -f ${D}/${systemd_unitdir}/system/docker.service.rpm
else
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init
fi
+ # TLS key that docker creates at run-time if not found is what resides here
+ if ${@bb.utils.contains('PACKAGECONFIG','transient-config','true','false',d)}; then
+ install -d ${D}${sysconfdir}
+ ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker
+ else
+ install -d ${D}${sysconfdir}/docker
+ fi
mkdir -p ${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/*"
+FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker"
FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
RDEPENDS_${PN}-contrib += "bash"
-
-# DO NOT STRIP docker
-INHIBIT_PACKAGE_STRIP = "1"
-INSANE_SKIP_${PN} += "ldflags"
diff --git a/external/meta-virtualization/recipes-containers/docker/docker_git.bb b/external/meta-virtualization/recipes-containers/docker/docker-moby.bb
index 79578083..074ef08f 100644
--- a/external/meta-virtualization/recipes-containers/docker/docker_git.bb
+++ b/external/meta-virtualization/recipes-containers/docker/docker-moby.bb
@@ -9,8 +9,8 @@ DESCRIPTION = "Linux container runtime \
large-scale web deployments, database clusters, continuous deployment \
systems, private PaaS, service-oriented architectures, etc. \
. \
- This package contains the daemon and client. Using docker.io is \
- officially supported on x86_64 and arm (32-bit) hosts. \
+ This package contains the daemon and client, which are \
+ officially supported on x86_64 and arm hosts. \
Other architectures are considered experimental. \
. \
Also, note that kernel version 3.10 or above is required for proper \
@@ -18,17 +18,37 @@ DESCRIPTION = "Linux container runtime \
subtle and/or glaring issues. \
"
-SRCREV_docker = "489b8eda6674523df8b82a210399b7d2954427d0"
-SRCREV_libnetwork = "6da50d1978302f04c3e2089e29112ea24812f05b"
-SRCREV_cli = "51668a30f26250ccfce31bcc13d9334eaafabe36"
+# Notes:
+# - This docker variant uses moby and the other individually maintained
+# upstream variants for SRCREVs
+# - It is a true community / upstream tracking build, and is not a
+# docker curated set of commits or additions
+# - The version number on this package tracks the versions assigned to
+# the curated docker-ce repository. This allows compatibility and
+# functional equivalence, while allowing new features to be more
+# easily added.
+# - This could be called "docker-moby" or just "moby" in the future, but
+# that would require the creation of a virtual/docker dependency, which
+# is possible, but overkill at the moment (while we wait for the upstream
+# to stop changing).
+# - The common components of this recipe and docker-ce do need to be moved
+# to a docker.inc recipe
+
+# moby commit matches the docker-engine bump on the 19.03 branch'
+SRCREV_moby = "aa6a9891b09cce3d9004121294301a30d45d998d"
+SRCREV_libnetwork = "c7bae399e46fd620b8a006174b7327e4e6e647fd"
+SRCREV_cli = "eb310fca49568dccd87c6136f774ef6fff2a1b51"
SRC_URI = "\
- git://github.com/moby/moby.git;nobranch=1;name=docker \
- git://github.com/docker/libnetwork.git;branch=bump_18.09;name=libnetwork;destsuffix=git/libnetwork \
- git://github.com/docker/cli;branch=18.09;name=cli;destsuffix=git/cli \
+ git://github.com/moby/moby.git;branch=19.03;name=moby \
+ git://github.com/docker/libnetwork.git;branch=bump_19.03;name=libnetwork;destsuffix=git/libnetwork \
+ git://github.com/docker/cli;branch=19.03;name=cli;destsuffix=git/cli \
file://docker.init \
- file://0001-libnetwork-use-GO-instead-of-go.patch \
+ file://0001-libnetwork-use-GO-instead-of-go.patch \
+ file://0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch \
"
+require docker.inc
+
# Apache-2.0 for docker
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://src/import/LICENSE;md5=4859e97a9c7780e77972d989f0823f28"
@@ -37,50 +57,17 @@ GO_IMPORT = "import"
S = "${WORKDIR}/git"
-DOCKER_VERSION = "18.09.0"
-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 \
- "
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[seccomp] = "seccomp,,libseccomp"
+DOCKER_VERSION = "19.03.8"
+PV = "${DOCKER_VERSION}+git${SRCREV_moby}"
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)} \
- "
-RDEPENDS_${PN} += "virtual/containerd virtual/runc"
-
-RRECOMMENDS_${PN} = "kernel-module-dm-thin-pool kernel-module-nf-nat docker-init"
-RSUGGESTS_${PN} = "lxc rt-tests"
DOCKER_PKG="github.com/docker/docker"
+# in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056
+BUILD_TAGS = "exclude_graphdriver_btrfs exclude_graphdriver_devicemapper"
-inherit systemd update-rc.d
inherit go
inherit goarch
-inherit pkgconfig
do_configure[noexec] = "1"
@@ -106,8 +93,7 @@ do_compile() {
export CGO_ENABLED="1"
export CGO_CFLAGS="${CFLAGS} --sysroot=${STAGING_DIR_TARGET}"
export CGO_LDFLAGS="${LDFLAGS} --sysroot=${STAGING_DIR_TARGET}"
- # in order to exclude devicemapper and btrfs - https://github.com/docker/docker/issues/14056
- export DOCKER_BUILDTAGS='exclude_graphdriver_btrfs exclude_graphdriver_devicemapper ${PACKAGECONFIG_CONFARGS}'
+ export DOCKER_BUILDTAGS='${BUILD_TAGS} ${PACKAGECONFIG_CONFARGS}'
export DISABLE_WARN_OUTSIDE_CONTAINER=1
@@ -116,33 +102,24 @@ do_compile() {
# this is the unsupported built structure
# that doesn't rely on an existing docker
# to build this:
- VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" ./hack/make.sh dynbinary
+ VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_moby}" ./hack/make.sh dynbinary
# build the cli
cd ${S}/src/import/.gopath/src/github.com/docker/cli
export CFLAGS=""
export LDFLAGS=""
export DOCKER_VERSION=${DOCKER_VERSION}
- VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_docker}" make dynbinary
+ VERSION="${DOCKER_VERSION}" DOCKER_GITCOMMIT="${SRCREV_moby}" make dynbinary
# build the proxy
cd ${S}/src/import/.gopath/src/github.com/docker/libnetwork
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() {
mkdir -p ${D}/${bindir}
cp ${WORKDIR}/git/cli/build/docker ${D}/${bindir}/docker
- cp ${S}/src/import/bundles/latest/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd
+ cp ${S}/src/import/bundles/dynbinary-daemon/dockerd ${D}/${bindir}/dockerd
cp ${WORKDIR}/git/libnetwork/bin/docker-proxy* ${D}/${bindir}/docker-proxy
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
@@ -150,24 +127,24 @@ do_install() {
install -m 644 ${S}/src/import/contrib/init/systemd/docker.* ${D}/${systemd_unitdir}/system
# replaces one copied from above with one that uses the local registry for a mirror
install -m 644 ${S}/src/import/contrib/init/systemd/docker.service ${D}/${systemd_unitdir}/system
+ rm -f ${D}/${systemd_unitdir}/system/docker.service.rpm
else
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/docker.init ${D}${sysconfdir}/init.d/docker.init
fi
+ # TLS key that docker creates at run-time if not found is what resides here
+ if ${@bb.utils.contains('PACKAGECONFIG','transient-config','true','false',d)}; then
+ install -d ${D}${sysconfdir}
+ ln -s ..${localstatedir}/run/docker ${D}${sysconfdir}/docker
+ else
+ install -d ${D}${sysconfdir}/docker
+ fi
mkdir -p ${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/*"
+FILES_${PN} += "${systemd_unitdir}/system/* ${sysconfdir}/docker"
FILES_${PN}-contrib += "${datadir}/docker/check-config.sh"
RDEPENDS_${PN}-contrib += "bash"
-
-# DO NOT STRIP docker
-INHIBIT_PACKAGE_STRIP = "1"
-INSANE_SKIP_${PN} += "ldflags textrel"
diff --git a/external/meta-virtualization/recipes-containers/docker/docker-moby/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch b/external/meta-virtualization/recipes-containers/docker/docker-moby/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch
new file mode 100644
index 00000000..766425a8
--- /dev/null
+++ b/external/meta-virtualization/recipes-containers/docker/docker-moby/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch
@@ -0,0 +1,61 @@
+From 1263fdb50a540e9db742694b7cee08284ad986d0 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 17 Jul 2019 17:34:04 +0800
+Subject: [PATCH] imporve hardcoded CC on cross compile
+
+Since commit applied in moby [61a3285 Support cross-compile for arm]
+it hardcoded var-CC to support cross-compile for arm
+
+Correct it with "${parameter:-word}" format, it is helpful for user
+define toolchains
+
+(Use Default Values. If parameter is unset or null, the expansion of
+word is substituted. Otherwise, the value of parameter is substituted.)
+
+Upstream-Status: Submitted [https://github.com/moby/moby/pull/39546]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ components/engine/hack/make/.binary | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/import/hack/make/.binary b/src/import/hack/make/.binary
+index 53de6749e5..66f4ca05f3 100644
+--- a/src/import/hack/make/.binary
++++ b/src/import/hack/make/.binary
+@@ -44,27 +44,27 @@ if [ "$(go env GOOS)/$(go env GOARCH)" != "$(go env GOHOSTOS)/$(go env GOHOSTARC
+ # must be cross-compiling!
+ case "$(go env GOOS)/$(go env GOARCH)" in
+ windows/amd64)
+- export CC=x86_64-w64-mingw32-gcc
++ export CC="${CC:-x86_64-w64-mingw32-gcc}"
+ export CGO_ENABLED=1
+ ;;
+ linux/arm)
+ case "${GOARM}" in
+ 5|"")
+- export CC=arm-linux-gnueabi-gcc
++ export CC="${CC:-arm-linux-gnueabi-gcc}"
+ export CGO_ENABLED=1
+ ;;
+ 7)
+- export CC=arm-linux-gnueabihf-gcc
++ export CC="${CC:-arm-linux-gnueabihf-gcc}"
+ export CGO_ENABLED=1
+ ;;
+ esac
+ ;;
+ linux/arm64)
+- export CC=aarch64-linux-gnu-gcc
++ export CC="${CC:-aarch64-linux-gnu-gcc}"
+ export CGO_ENABLED=1
+ ;;
+ linux/amd64)
+- export CC=x86_64-linux-gnu-gcc
++ export CC="${CC:-x86_64-linux-gnu-gcc}"
+ export CGO_ENABLED=1
+ ;;
+ esac
+--
+2.23.0
+
diff --git a/external/meta-virtualization/recipes-containers/docker/docker.inc b/external/meta-virtualization/recipes-containers/docker/docker.inc
new file mode 100644
index 00000000..32d4a2e4
--- /dev/null
+++ b/external/meta-virtualization/recipes-containers/docker/docker.inc
@@ -0,0 +1,65 @@
+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 kernel-module-xt-addrtype"
+
+PROVIDES += "virtual/docker"
+
+# we want all the docker variant recpes to be installable via "docker"
+PACKAGE_NAME = "docker"
+RPROVIDES_${PN} += "docker"
+RPROVIDES_${PN}-dbg += "docker-dbg"
+RPROVIDES_${PN}-dev += "docker-dev"
+RPROVIDES_${PN}-contrip += "docker-dev"
+
+inherit pkgconfig
+PACKAGECONFIG ??= "docker-init"
+PACKAGECONFIG[seccomp] = "seccomp,,libseccomp"
+PACKAGECONFIG[docker-init] = ",,,docker-init"
+PACKAGECONFIG[transient-config] = "transient-config"
+
+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).*"
+
+INSANE_SKIP_${PN} += "ldflags textrel"
diff --git a/external/meta-virtualization/recipes-containers/docker/files/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch b/external/meta-virtualization/recipes-containers/docker/files/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch
new file mode 100644
index 00000000..70fdaf83
--- /dev/null
+++ b/external/meta-virtualization/recipes-containers/docker/files/0001-imporve-hardcoded-CC-on-cross-compile-docker-ce.patch
@@ -0,0 +1,61 @@
+From 1263fdb50a540e9db742694b7cee08284ad986d0 Mon Sep 17 00:00:00 2001
+From: Hongxu Jia <hongxu.jia@windriver.com>
+Date: Wed, 17 Jul 2019 17:34:04 +0800
+Subject: [PATCH] imporve hardcoded CC on cross compile
+
+Since commit applied in moby [61a3285 Support cross-compile for arm]
+it hardcoded var-CC to support cross-compile for arm
+
+Correct it with "${parameter:-word}" format, it is helpful for user
+define toolchains
+
+(Use Default Values. If parameter is unset or null, the expansion of
+word is substituted. Otherwise, the value of parameter is substituted.)
+
+Upstream-Status: Submitted [https://github.com/moby/moby/pull/39546]
+
+Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
+---
+ components/engine/hack/make/.binary | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/src/import/components/engine/hack/make/.binary b/src/import/components/engine/hack/make/.binary
+index 53de6749e5..66f4ca05f3 100644
+--- a/src/import/components/engine/hack/make/.binary
++++ b/src/import/components/engine/hack/make/.binary
+@@ -44,27 +44,27 @@ if [ "$(go env GOOS)/$(go env GOARCH)" != "$(go env GOHOSTOS)/$(go env GOHOSTARC
+ # must be cross-compiling!
+ case "$(go env GOOS)/$(go env GOARCH)" in
+ windows/amd64)
+- export CC=x86_64-w64-mingw32-gcc
++ export CC="${CC:-x86_64-w64-mingw32-gcc}"
+ export CGO_ENABLED=1
+ ;;
+ linux/arm)
+ case "${GOARM}" in
+ 5|"")
+- export CC=arm-linux-gnueabi-gcc
++ export CC="${CC:-arm-linux-gnueabi-gcc}"
+ export CGO_ENABLED=1
+ ;;
+ 7)
+- export CC=arm-linux-gnueabihf-gcc
++ export CC="${CC:-arm-linux-gnueabihf-gcc}"
+ export CGO_ENABLED=1
+ ;;
+ esac
+ ;;
+ linux/arm64)
+- export CC=aarch64-linux-gnu-gcc
++ export CC="${CC:-aarch64-linux-gnu-gcc}"
+ export CGO_ENABLED=1
+ ;;
+ linux/amd64)
+- export CC=x86_64-linux-gnu-gcc
++ export CC="${CC:-x86_64-linux-gnu-gcc}"
+ export CGO_ENABLED=1
+ ;;
+ esac
+--
+2.23.0
+
diff --git a/external/meta-virtualization/recipes-containers/docker/files/docker.init b/external/meta-virtualization/recipes-containers/docker/files/docker.init
index 0aea8d01..24f8fea6 100644
--- a/external/meta-virtualization/recipes-containers/docker/files/docker.init
+++ b/external/meta-virtualization/recipes-containers/docker/files/docker.init
@@ -28,7 +28,7 @@ exec="/usr/bin/$prog"
pidfile="/var/run/$prog.pid"
lockfile="/var/lock/subsys/$prog"
logfile="/var/log/$prog"
-other_args="--registry-mirror=http://localhost:5000 --insecure-registry=http://localhost:5000 --raw-logs"
+other_args="--pidfile $pidfile --registry-mirror=http://localhost:5000 --insecure-registry=http://localhost:5000 --raw-logs"
[ -e /etc/sysconfig/$prog ] && . /etc/sysconfig/$prog
@@ -40,7 +40,7 @@ start() {
if ! [ -f $pidfile ]; then
printf "Starting $prog:\t"
echo -e "\n$(date)\n" >> $logfile
- "$unshare" -m -- $exec $other_args &>> $logfile &
+ "$unshare" -m -- $exec $other_args >> $logfile 2>&1 &
pid=$!
touch $lockfile
# wait up to 10 seconds for the pidfile to exist. see