binfmt: Building Docker Fedora ARM v7 images fails as 'Out of memory allocating XXX bytes'

Behaviour

When building a Docker Fedora ARMv7 image, this has been failing for the last 2 months, with the following error:

#19 263.9 Out of memory allocating 536870912 bytes!

This appears to be linked to when a new image was released qemu-v7.0.0-28

If I force to use the prior version of qemu qemu-v6.2.0-26 there is no issue and the images are built correctly and in a timely fashion.

- uses: docker/setup-qemu-action@v2
        with:
          image: tonistiigi/binfmt:qemu-v6.2.0-26
          platforms: all

This issue only impacts Fedora ARM v7 builds, other platforms such as Debian | Ubuntu are not impacted.

Steps to reproduce this issue

Build an image for Fedora ARM v7 within a ‘matrix’.

- uses: docker/setup-qemu-action@v2
        with:
          image: tonistiigi/binfmt:latest
          platforms: all

Expected behaviour

Builds for Fedora ARMv7 should build without issue

Actual behaviour

Fedora ARMv7 builds fail with Out of memory allocating XXX bytes

Configuration

  • Repository URL (if public):
  • Build URL (if public):
name: Build Docker Images

on:
  push:
    branches: [ master ]
    tags: [ 'v*' ]
  pull_request:
    branches:
      - master
    types: [closed]

env:
  DOCKER_HUB_SLUG: driveone/onedrive

jobs:
  build:
    if: (!(github.event.action == 'closed' && github.event.pull_request.merged != true))
    runs-on: ubuntu-latest

    strategy:
      matrix:
        flavor: [ fedora, debian, alpine ]
        include:
          - flavor: fedora
            dockerfile: ./contrib/docker/Dockerfile
            platforms: linux/amd64,linux/arm64
          - flavor: debian
            dockerfile: ./contrib/docker/Dockerfile-debian
            platforms: linux/amd64,linux/arm64,linux/arm/v7
          - flavor: alpine
            dockerfile: ./contrib/docker/Dockerfile-alpine
            platforms: linux/amd64,linux/arm64

    steps:
      - name: Check out code from GitHub
        uses: actions/checkout@v3
        with:
          submodules: recursive
          fetch-depth: 0

      - name: Docker meta
        id: docker_meta
        uses: marcelcoding/ghaction-docker-meta@v2
        with:
          tag-edge: true
          images: |
            ${{ env.DOCKER_HUB_SLUG }}
          tag-semver: |
            {{version}}
            {{major}}.{{minor}}
          flavor: ${{ matrix.flavor }}
          main-flavor: ${{ matrix.flavor == 'fedora' }}

      - uses: docker/setup-qemu-action@v2
        if: matrix.platforms != 'linux/amd64'

      - uses: docker/setup-buildx-action@v2

      - name: Cache Docker layers
        uses: actions/cache@v3
        with:
          path: /tmp/.buildx-cache
          key: ${{ runner.os }}-buildx-${{ matrix.flavor }}-${{ github.sha }}
          restore-keys: |
            ${{ runner.os }}-buildx-${{ matrix.flavor }}

      - name: Login to Docker Hub
        uses: docker/login-action@v2
        if: github.event_name != 'pull_request'
        with:
          username: ${{ secrets.DOCKER_USERNAME }}
          password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

      - name: Build and Push to Docker
        uses: docker/build-push-action@v3
        with:
          context: .
          file: ${{ matrix.dockerfile }}
          platforms: ${{ matrix.platforms }}
          push: ${{ github.event_name != 'pull_request' }}
          tags: ${{ steps.docker_meta.outputs.tags }}
          labels: ${{ steps.docker_meta.outputs.labels }}
          cache-from: type=local,src=/tmp/.buildx-cache
          cache-to: type=local,dest=/tmp/.buildx-cache-new

      - name: Move cache
        run: |
          rm -rf /tmp/.buildx-cache
          mv /tmp/.buildx-cache-new /tmp/.buildx-cache

Logs

Failed build logs_1109.zip

Working build with downgraded qemu

logs_1132.zip

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 18

Commits related to this issue

Most upvoted comments

You can switch to tonistiigi/binfmt:qemu-v6.2.0 in the meantime.

@crazy-max Unfortunately the build fails - either with the original gosu or even the updated option you suggested of using ‘gosu’ from ‘yasu’:

image

Error:

image