docker-ce: update to v20.10-beta

moby has moved on to the 20.10+ series, while docker-ce has
stayed behind a bit.

Master of docker-ce now has imports from moby and is getting
ready for release.

To keep our variants from diverging, we switch to master (for
now) and will track the new development.

We adapt some patches from the moby build to work for docker-ce,
in particular, we cannot use docker to build docker, so we
port the cli building from moby.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
This commit is contained in:
Bruce Ashfield 2021-04-15 17:10:26 -04:00
parent 34087227ee
commit 2cc2bc1acf
5 changed files with 70 additions and 81 deletions

View File

@ -0,0 +1,26 @@
From 45d03c7b04353d2e5955e573bc1063fcb0647a0c Mon Sep 17 00:00:00 2001
From: Bruce Ashfield <bruce.ashfield@gmail.com>
Date: Thu, 15 Apr 2021 16:30:37 -0400
Subject: [PATCH] build: use build script without docker
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
git/src/import/components/cli/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git git/src/import/components/cli/Makefile git/src/import/components/cli/Makefile
index 9e62210c33..9c7631f674 100644
--- git/src/import/components/cli/Makefile
+++ git/src/import/components/cli/Makefile
@@ -51,7 +51,7 @@ plugins-osx: ## build example CLI plugins for macOS
.PHONY: dynbinary
dynbinary: ## build dynamically linked binary
- USE_GLIBC=1 docker buildx bake dynbinary
+ GO_LINKMODE=dynamic ./scripts/build/binary
vendor: vendor.conf ## check that vendor matches vendor.conf
rm -rf vendor
--
2.19.1

View File

@ -0,0 +1,27 @@
From 650c882d3c53db118b01dd5e15fa1bc0ddaa36f1 Mon Sep 17 00:00:00 2001
From: Bruce Ashfield <bruce.ashfield@gmail.com>
Date: Thu, 15 Apr 2021 11:28:05 -0400
Subject: [PATCH] cli: use external GO111MODULE and cross compiler
Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
git/src/import/components/cli/scripts/build/binary | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git git/src/import/components/cli/scripts/build/binary git/src/import/components/cli/scripts/build/binary
index e4c5e12a6b..7c47b75c2f 100755
--- git/src/import/components/cli/scripts/build/binary
+++ git/src/import/components/cli/scripts/build/binary
@@ -73,8 +73,7 @@ fi
echo "Building $GO_LINKMODE $(basename "${TARGET}")"
-export GO111MODULE=auto
-go build -o "${TARGET}" -tags "${GO_BUILDTAGS}" --ldflags "${LDFLAGS}" ${GO_BUILDMODE} "${SOURCE}"
+${GO} build -o "${TARGET}" -tags "${GO_BUILDTAGS}" --ldflags "${LDFLAGS}" ${GO_BUILDMODE} "${SOURCE}"
ln -sf "$(basename "${TARGET}")" "$(dirname "${TARGET}")/docker"
--
2.19.1

View File

@ -8,11 +8,11 @@ Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
hack/make/.binary | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/import/components/engine/hack/make/.binary b/src/import/components/engine/hack/make/.binary
index 53de6749e5..47ab2a754f 100644
--- a/src/import/components/engine/hack/make/.binary
+++ b/src/import/components/engine/hack/make/.binary
@@ -81,7 +81,7 @@ esac
Index: git/src/import/components/engine/hack/make/.binary
===================================================================
--- git.orig/src/import/components/engine/hack/make/.binary
+++ git/src/import/components/engine/hack/make/.binary
@@ -81,7 +81,7 @@
echo "Building: $DEST/$BINARY_FULLNAME"
echo "GOOS=\"${GOOS}\" GOARCH=\"${GOARCH}\" GOARM=\"${GOARM}\""
@ -21,6 +21,3 @@ index 53de6749e5..47ab2a754f 100644
-o "$DEST/$BINARY_FULLNAME" \
"${BUILDFLAGS[@]}" \
-ldflags "
--
2.19.1

View File

@ -1,61 +0,0 @@
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

View File

@ -18,16 +18,16 @@ DESCRIPTION = "Linux container runtime \
subtle and/or glaring issues. \
"
SRCREV_docker = "99e3ed89195c4e551e87aad1e7453b65456b03ad"
SRCREV_docker = "42aa775803d44af077f0e0099c67708ad0814fe7"
SRCREV_libnetwork = "55e924b8a84231a065879156c0de95aefc5f5435"
SRC_URI = "\
git://github.com/docker/docker-ce.git;branch=19.03;name=docker \
git://github.com/docker/docker-ce.git;branch=master;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 \
file://0001-dynbinary-use-go-cross-compiler.patch \
file://0001-cli-use-go-cross-compiler.patch \
file://0001-cli-use-external-GO111MODULE-and-cross-compiler.patch \
file://0001-build-use-build-script-without-docker.patch \
"
require docker.inc
@ -40,7 +40,7 @@ GO_IMPORT = "import"
S = "${WORKDIR}/git"
DOCKER_VERSION = "v19.03.15-ce"
DOCKER_VERSION = "v20.10.0-beta1-ce"
PV = "${DOCKER_VERSION}+git${SRCREV_docker}"
PACKAGES =+ "${PN}-contrib"