mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #40058 from cpuguy83/buildkit_dockerfile
Fix `make cross` target
This commit is contained in:
commit
6f069f14e6
1 changed files with 17 additions and 21 deletions
12
Dockerfile
12
Dockerfile
|
@ -91,19 +91,17 @@ RUN /download-frozen-image-v2.sh /build \
|
|||
|
||||
FROM base AS cross-false
|
||||
|
||||
FROM base AS cross-true
|
||||
FROM --platform=linux/amd64 base AS cross-true
|
||||
ARG DEBIAN_FRONTEND
|
||||
RUN dpkg --add-architecture armhf
|
||||
RUN dpkg --add-architecture arm64
|
||||
RUN dpkg --add-architecture armel
|
||||
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 \
|
||||
if [ "$(go env GOHOSTARCH)" = "amd64" ]; then \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
crossbuild-essential-armhf \
|
||||
crossbuild-essential-arm64 \
|
||||
crossbuild-essential-armel \
|
||||
fi
|
||||
crossbuild-essential-armel
|
||||
|
||||
FROM cross-${CROSS} as dev-base
|
||||
|
||||
|
@ -115,7 +113,7 @@ RUN --mount=type=cache,sharing=locked,id=moby-cross-false-aptlib,target=/var/lib
|
|||
libapparmor-dev \
|
||||
libseccomp-dev
|
||||
|
||||
FROM cross-true AS runtime-dev-cross-true
|
||||
FROM --platform=linux/amd64 cross-true AS runtime-dev-cross-true
|
||||
ARG DEBIAN_FRONTEND
|
||||
# These crossbuild packages rely on gcc-<arch>, but this doesn't want to install
|
||||
# on non-amd64 systems.
|
||||
|
@ -123,7 +121,6 @@ ARG DEBIAN_FRONTEND
|
|||
# other architectures cannnot crossbuild amd64.
|
||||
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 \
|
||||
if [ "$(go env GOHOSTARCH)" = "amd64" ]; then \
|
||||
apt-get update && apt-get install -y --no-install-recommends \
|
||||
libseccomp-dev:armhf \
|
||||
libseccomp-dev:arm64 \
|
||||
|
@ -134,8 +131,7 @@ RUN --mount=type=cache,sharing=locked,id=moby-cross-true-aptlib,target=/var/lib/
|
|||
# install this arches seccomp here due to compat issues with the v0 builder
|
||||
# This is as opposed to inheriting from runtime-dev-cross-false
|
||||
libapparmor-dev \
|
||||
libseccomp-dev \
|
||||
fi
|
||||
libseccomp-dev
|
||||
|
||||
|
||||
FROM runtime-dev-cross-${CROSS} AS runtime-dev
|
||||
|
|
Loading…
Add table
Reference in a new issue