Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ubuntu-22: Add initial support for multi-platform builds #92

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
for sub in $SUB_IMAGES; do
IMG=$(tr '[:upper:]' '[:lower:]' <<< "${REGISTRY}/${REPOSITORY}/${IMAGE_NAME}-${sub}")
echo "Building Image: ${IMG}:${short_sha}..."
docker build --target "${sub}" --tag "${IMG}:${short_sha}" -f Dockerfile .
docker build --target "${sub}" --platform linux/amd64 --tag "${IMG}:${short_sha}" -f Dockerfile .
done
docker images
shell: bash
Expand Down
14 changes: 12 additions & 2 deletions Ubuntu-22/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,21 @@ RUN apt-get update && \
python3-venv \
locales \
gnupg \
ca-certificates && \
ca-certificates

RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
apt-get install --yes --no-install-recommends \
g++-${GCC_MAJOR_VERSION}-aarch64-linux-gnu gcc-${GCC_MAJOR_VERSION}-aarch64-linux-gnu; \
fi

RUN if [ "TARGETPLATFORM" = "linux/arm64" ]; then \
apt-get install --yes --no-install-recommends \
g++-${GCC_MAJOR_VERSION}-x86-64-linux-gnu gcc-${GCC_MAJOR_VERSION}-x86-64-linux-gnu; \
fi

RUN apt-get install --yes --no-install-recommends \
g++-${GCC_MAJOR_VERSION} gcc-${GCC_MAJOR_VERSION} \
g++-${GCC_MAJOR_VERSION}-x86-64-linux-gnux32 gcc-${GCC_MAJOR_VERSION}-x86-64-linux-gnux32 \
g++-${GCC_MAJOR_VERSION}-aarch64-linux-gnu gcc-${GCC_MAJOR_VERSION}-aarch64-linux-gnu \
g++-${GCC_MAJOR_VERSION}-riscv64-linux-gnu gcc-${GCC_MAJOR_VERSION}-riscv64-linux-gnu \
g++-${GCC_MAJOR_VERSION}-arm-linux-gnueabi gcc-${GCC_MAJOR_VERSION}-arm-linux-gnueabi \
g++-${GCC_MAJOR_VERSION}-arm-linux-gnueabihf gcc-${GCC_MAJOR_VERSION}-arm-linux-gnueabihf && \
Expand Down
Loading