Do I need this action to build for 32-bit architecture in docker on GitHub Actions #282
-
|
Hey, I am using ubuntu-latest runner and came up with a pipeline that builds a docker image when it is modified, like below (I am working with legacy software and need this old compatibility) name: Build Linux Docker Image
on:
push:
paths:
- 'ci/linux/Dockerfile'
workflow_dispatch:
permissions:
contents: read
packages: write
env:
IMAGE_NAME: ghcr.io/${{ github.repository_owner }}/ags-linux-builder-image
BRANCH_TAG: ${{ github.ref_name }}
jobs:
build-and-push-amd64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and push amd64 image
uses: docker/build-push-action@v7
with:
context: ci/linux
file: ci/linux/Dockerfile
platforms: linux/amd64
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ env.BRANCH_TAG }}-amd64
build-args: |
FROM_PLATFORM=linux/amd64
FROM_DEBIAN=debian/eol:jessie
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:${{ env.BRANCH_TAG }}-amd64-buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:${{ env.BRANCH_TAG }}-amd64-buildcache,mode=max
build-and-push-i386:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Log in to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4
- name: Build and push i386 image
uses: docker/build-push-action@v7
with:
context: ci/linux
file: ci/linux/Dockerfile
platforms: linux/386
push: true
tags: |
${{ env.IMAGE_NAME }}:${{ env.BRANCH_TAG }}-i386
build-args: |
FROM_PLATFORM=linux/386
FROM_DEBIAN=debian/eol:jessie
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:${{ env.BRANCH_TAG }}-i386-buildcache
cache-to: type=registry,ref=${{ env.IMAGE_NAME }}:${{ env.BRANCH_TAG }}-i386-buildcache,mode=maxWould I need to ad something like On the 32-bit pipeline? Or I am misunderstanding the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
For
QEMU is mainly needed when the build has to execute binaries for a non-native architecture. That is the common case for amd64 runners building ARM, PowerPC, RISC-V, s390x, etc So for your - uses: docker/setup-buildx-action@v3
- uses: docker/build-push-action@v6
with:
platforms: linux/386A couple of caveats:
For |
Beta Was this translation helpful? Give feedback.
For
linux/386on a GitHub-hostedubuntu-latestrunner, you normally do not needdocker/setup-qemu-actionlinux/386is still x86. On an amd64 Linux runner, 32-bit x86 userspace can usually run through the host kernel's native compatibility support, so BuildKit does not need QEMU in the same way it would for a different ISA such aslinux/arm64,linux/arm/v7,linux/ppc64le,linux/riscv64, orlinux/s390xQEMU is mainly needed when the build has to execute binaries for a non-native architecture. That is the common case for amd64 runners building ARM, PowerPC, RISC-V, s390x, etc
So for your
linux/386job, this should usually be enough: