Merge pull request #42524 from fredericdalleau/crossbuild
Crosscompilation for s390x and ppc64le
This commit is contained in:
commit
7d471d88a0
3 changed files with 16 additions and 6 deletions
12
Dockerfile
12
Dockerfile
|
@ -97,12 +97,16 @@ ARG DEBIAN_FRONTEND
|
|||
RUN dpkg --add-architecture arm64
|
||||
RUN dpkg --add-architecture armel
|
||||
RUN dpkg --add-architecture armhf
|
||||
RUN dpkg --add-architecture ppc64el
|
||||
RUN dpkg --add-architecture s390x
|
||||
RUN --mount=type=cache,sharing=locked,id=moby-cross-true-aptlib,target=/var/lib/apt \
|
||||
--mount=type=cache,sharing=locked,id=moby-cross-true-aptcache,target=/var/cache/apt \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
crossbuild-essential-arm64 \
|
||||
crossbuild-essential-armel \
|
||||
crossbuild-essential-armhf
|
||||
crossbuild-essential-armhf \
|
||||
crossbuild-essential-ppc64el \
|
||||
crossbuild-essential-s390x
|
||||
|
||||
FROM cross-${CROSS} as dev-base
|
||||
|
||||
|
@ -127,16 +131,14 @@ ARG DEBIAN_FRONTEND
|
|||
# on non-amd64 systems.
|
||||
# Additionally, the crossbuild-amd64 is currently only on debian:buster, so
|
||||
# other architectures cannnot crossbuild amd64.
|
||||
RUN echo 'deb http://deb.debian.org/debian buster-backports main' > /etc/apt/sources.list.d/backports.list
|
||||
RUN --mount=type=cache,sharing=locked,id=moby-cross-true-aptlib,target=/var/lib/apt \
|
||||
--mount=type=cache,sharing=locked,id=moby-cross-true-aptcache,target=/var/cache/apt \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
libapparmor-dev:arm64 \
|
||||
libapparmor-dev:armel \
|
||||
libapparmor-dev:armhf \
|
||||
libseccomp-dev:arm64/buster-backports \
|
||||
libseccomp-dev:armel/buster-backports \
|
||||
libseccomp-dev:armhf/buster-backports
|
||||
libapparmor-dev:ppc64el \
|
||||
libapparmor-dev:s390x
|
||||
|
||||
FROM runtime-dev-cross-${CROSS} AS runtime-dev
|
||||
|
||||
|
|
|
@ -65,6 +65,14 @@ hash_files() {
|
|||
export CC="${CC:-x86_64-linux-gnu-gcc}"
|
||||
export CGO_ENABLED=1
|
||||
;;
|
||||
linux/ppc64le)
|
||||
export CC="${CC:-powerpc64le-linux-gnu-gcc}"
|
||||
export CGO_ENABLED=1
|
||||
;;
|
||||
linux/s390x)
|
||||
export CC="${CC:-s390x-linux-gnu-gcc}"
|
||||
export CGO_ENABLED=1
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ if [ -x "${DEST}/../binary-daemon/dockerd-${VERSION}" ]; then
|
|||
echo "Created symlinks:" "${DEST}/linux/${arch}/"*
|
||||
fi
|
||||
|
||||
DOCKER_CROSSPLATFORMS=${DOCKER_CROSSPLATFORMS:-"linux/amd64 windows/amd64"}
|
||||
DOCKER_CROSSPLATFORMS=${DOCKER_CROSSPLATFORMS:-"linux/amd64 windows/amd64 linux/ppc64le linux/s390x"}
|
||||
|
||||
for platform in ${DOCKER_CROSSPLATFORMS}; do
|
||||
(
|
||||
|
|
Loading…
Add table
Reference in a new issue