colima icon indicating copy to clipboard operation
colima copied to clipboard

multi-platform builds fail

Open vincer opened this issue 1 year ago • 3 comments

Description

When running docker build --platform linux/amd64,linux/arm64 . I get:

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/

Per this issue comment it sounds like this should work out of the box.

buildx says it's using Colima:

NAME/NODE       DRIVER/ENDPOINT   STATUS    BUILDKIT               PLATFORMS
colima*         docker
 \_ colima       \_ colima        running   v0.11.7+435cb77e369c   linux/arm64, linux/amd64, linux/amd64/v2
default                           error
desktop-linux                     error

Cannot load builder default: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Cannot load builder desktop-linux: Cannot connect to the Docker daemon at unix:///Users/vince/.docker/run/docker.sock. Is the docker daemon running?

I tried recreating the buildx builder, recreating the Colima instance and always get that message which refers me to Docker Desktop docs to enable the "containerd image store". Is there an equivalent step for Colima or some other step I need to take?

Version

git commit: c3a31ed05f5fab8b2cdbae835198e8fb1717fd0f

runtime: docker
arch: aarch64
client: v27.0.3
server: v24.0.9
limactl version 0.22.0
qemu-img version 9.0.1
Copyright (c) 2003-2024 Fabrice Bellard and the QEMU Project developers

Operating System

  • [ ] macOS Intel <= 13 (Ventura)
  • [ ] macOS Intel >= 14 (Sonoma)
  • [ ] Apple Silicon <= 13 (Ventura)
  • [X] Apple Silicon >= 14 (Sonoma)
  • [ ] Linux

Output of colima status

INFO[0000] colima is running using QEMU
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0000] socket: unix:///Users/vince/.colima/default/docker.sock

Reproduction Steps

docker build --platform linux/amd64,linux/arm64 .

Expected behaviour

A multi-platform image is built.

Additional context

No response

vincer avatar Jul 02 '24 18:07 vincer

This should help

docker buildx create --use --name super-builder

Noksa avatar Jul 04 '24 13:07 Noksa

@vincer Edit $HOME/.colima/default/colima.yaml to contain:

# NOTE: value cannot be changed after virtual machine is created.
# Default: qemu
vmType: vz

# Utilise rosetta for amd64 emulation (requires m1 mac and vmType `vz`)
# Default: false
rosetta: true
docker:
  features:
    containerd-snapshotter: true

Then run colima restart and containerd storage should become enabled.

elyulka avatar Oct 06 '24 15:10 elyulka

Then run colima restart and containerd storage should become enabled.

you may need to delete ~/.colima/_lima/colima/diffdisk if the restart fails. Had an error that its format was wrong. Deleting it and restarting colima again resolved that.

codesimplicity avatar Oct 10 '24 15:10 codesimplicity