abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
19.64k stars 397 forks source link

multi-platform builds fail #1057

Open vincer opened 4 months ago

vincer commented 4 months ago

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

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

Noksa commented 4 months ago

This should help

docker buildx create --use --name super-builder
elyulka commented 1 month ago

@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.

codesimplicity commented 1 month ago

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.