Skip to content

Confusing error when doing multi-platform builds with the containerd driver. #174

@CarterFendley

Description

@CarterFendley

Contributing guidelines

I've found a bug, and:

  • The documentation does not mention anything about my problem
  • There are no open or closed issues that are related to my problem

Description

Not sure exactly if this is an issue with how this action is setting things up, but going to start by noting the issue I had here. Feel free me to bounce me over to docker daemon people or containerd folks if they are who I should report this to.

When running a multi-platform build for linux/arm/v7 on the latest ubuntu runner, I got a somewhat unintelligible error during build:

0.650 exec /bin/sh: exec format error
ERROR: failed to build: failed to solve: process "/bin/sh -c which ls" did not complete successfully: exit code: 255

TL;DR: This would happen on any RUN command I tried until I used the setup-qemu-action to get QEMU on the runner.

After finding the solution, everything works just fine. However I am just confused why the build process would even attempt to start without having the needed emulators, and produce this error. I am using the containerd driver which your action helped me configure:

$ docker info -f '{{ .DriverStatus }}'
[[driver-type io.containerd.snapshotter.v1]]

And the builder instances report that they have multi-platform support (although not sure that means much because the default builder also reports multiple platforms but can not build for those).

$ docker buildx ls
 NAME/NODE                 DRIVER/ENDPOINT           STATUS    BUILDKIT   PLATFORMS
default                   docker                                         
 \_ default                \_ default               running   v0.20.2    linux/amd64 (+3), linux/arm64, linux/arm (+2), linux/ppc64le, (6 more)
setup-docker-action*      docker                                         
 \_ setup-docker-action    \_ setup-docker-action   running   v0.24.0    linux/amd64 (+3), linux/arm64, linux/arm (+2), linux/ppc64le, (5 more)

As mentioned at the start, not sure this is the right place for this, but hoping the maintainers here can tell me more about who to ask. Thanks for this action, huge help 👍

Expected behaviour

Some sort of error telling me to install QEMU?

Actual behaviour

Build starts without warning or error and fails with an obscure message.

Repository URL

No response

Workflow run URL

No response

YAML workflow

- name: Set up Docker
        uses: docker/setup-docker-action@v4
        with:
          daemon-config: |
            {
              "features": {
                "containerd-snapshotter": true
              }
            }
      - name: Docker context debug
        run: |
          docker info -f '{{ .DriverStatus }}'
          docker buildx ls
      - name: Build docker image
        run: docker build --platform linux/arm/v7 .

Workflow logs

No response

Docker daemon logs


Additional info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions