Skip to content

Conversation

gentoo-root
Copy link
Contributor

It seems that the output of docker buildx ls doesn't match the expectation of the command that we use:

docker buildx ls | grep -E -e "[a-zA-Z0-9-]+ \*" | cut -d ' ' -f1

With the current versions of Docker (28.1.1) and buildx (0.23.0), the output of docker buildx ls looks like this:

NAME/NODE            DRIVER/ENDPOINT                   STATUS    BUILDKIT   PLATFORMS
naughty_mayer*       docker-container
 \_ naughty_mayer0    \_ unix:///var/run/docker.sock   running   v0.21.1    linux/amd64* (+4), linux/arm64*, linux/386
default              docker
 \_ default           \_ default                       running   v0.21.0    linux/amd64 (+4), linux/386

...and the above command's output is empty.

Change the command to the following:

docker buildx ls --format '{{ .Name }}' | head -n1

...assuming that the idea is to get the name of the first builder, check if it's default (or default-linux), and if it is, create an actual one that would use the docker-container driver and be able to build multi-arch images.

This fix resolves the following error message on machines that don't have a suitable builder in advance:

ERROR: Multi-platform build is not supported for the docker driver.
Switch to a different driver, or turn on the containerd image store, and try again.
Learn more at https://docs.docker.com/go/build-multi-platform/

@gentoo-root gentoo-root requested a review from a team as a code owner May 22, 2025 15:38
@gentoo-root gentoo-root requested a review from joestringer May 22, 2025 15:38
@gentoo-root gentoo-root added the release-note/misc This PR makes changes that have no direct user impact. label May 22, 2025
@gentoo-root gentoo-root requested a review from jrajahalme May 22, 2025 15:39
Copy link
Contributor

@michi-covalent michi-covalent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good

@michi-covalent michi-covalent enabled auto-merge May 22, 2025 15:39
@joestringer
Copy link
Member

Please rebase against the tip of main branch to fix the CI issues.

@michi-covalent
Copy link
Contributor

michi-covalent commented May 22, 2025

not sure if it's related to this PR, but the image build failed 👀 https://github.com/cilium/cilium/actions/runs/15190884205/job/42723096009?pr=39681

Error: buildx failed with: ERROR: failed to solve: ResourceExhausted: failed to compute cache key: write /var/lib/buildkit/runc-overlayfs/snapshots/snapshots/68/fs/var/cache/debconf/templates.dat: no space left on device

edit: never mind joe beat me to it #39681 (comment)

@gentoo-root
Copy link
Contributor Author

@joestringer
Copy link
Member

I was hoping a rebase would fix that, but apparently not. I filed this issue to investigate:

#39682

It seems that the output of `docker buildx ls` doesn't match the
expectation of the command that we use:

    docker buildx ls | grep -E -e "[a-zA-Z0-9-]+ \*" | cut -d ' ' -f1

With the current versions of Docker (28.1.1) and buildx (0.23.0), the
output of `docker buildx ls` looks like this:

    NAME/NODE            DRIVER/ENDPOINT                   STATUS    BUILDKIT   PLATFORMS
    naughty_mayer*       docker-container
     \_ naughty_mayer0    \_ unix:///var/run/docker.sock   running   v0.21.1    linux/amd64* (+4), linux/arm64*, linux/386
    default              docker
     \_ default           \_ default                       running   v0.21.0    linux/amd64 (+4), linux/386

...and the above command's output is empty.

Change the command to the following:

    docker buildx ls --format '{{ .Name }}' | head -n1

...assuming that the idea is to get the name of the first builder, check
if it's default (or default-linux), and if it is, create an actual one
that would use the docker-container driver and be able to build
multi-arch images.

This fix resolves the following error message on machines that don't
have a suitable builder in advance:

    ERROR: Multi-platform build is not supported for the docker driver.
    Switch to a different driver, or turn on the containerd image store, and try again.
    Learn more at https://docs.docker.com/go/build-multi-platform/

Signed-off-by: Maxim Mikityanskiy <maxim@isovalent.com>
@gentoo-root
Copy link
Contributor Author

/test

@michi-covalent michi-covalent added this pull request to the merge queue May 23, 2025
Merged via the queue into main with commit bb91062 May 23, 2025
296 of 298 checks passed
@michi-covalent michi-covalent deleted the pr/max/fix-buildx branch May 23, 2025 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants