abiosoft / colima

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

Can't chroot from a vz container #1015

Open jemershaw opened 2 months ago

jemershaw commented 2 months ago

Description

When trying to run chroot in a amd64 container it core dumps when trying to run the chroot commands. It seems like docker desktop was able to fix this here.

Version

┗╸❯❯❯ colima version && limactl --version && qemu-img --version
colima version 0.6.8
git commit: 9b0809d0ed9ad3ff1e57c405f27324e6298ca04f

runtime: docker
arch: aarch64
client: v25.0.3
server: v24.0.9
limactl version 0.21.0
qemu-img version 8.2.1
Copyright (c) 2003-2023 Fabrice Bellard and the QEMU Project developers

Operating System

Output of colima status

┗╸❯❯❯ colima status
INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs
INFO[0000] socket: unix:///Users/jemershaw/.colima/default/docker.sock

Reproduction Steps

  1. colima start --activate -c 10 -d 100 -m 8 --ssh-agent --vm-type vz --vz-rosetta --mount-type virtiofs
  2. export DOCKER_DEFAULT_PLATFORM=linux/amd64
  3. DOCKER_DEFAULT_PLATFORM=linux/amd64 docker run --rm -it --privileged ubuntu
  4. apt-get update && apt-get install -y debootstrap
  5. mkdir -p /rootfs
  6. export DEBIAN_FRONTEND=noninteractive
  7. debootstrap focal /rootfs || \ (cat /rootfs/debootstrap/debootstrap.log && false)

Expected behaviour

The output should show

rosetta error: Unable to open /proc/self/exe: 40
 Trace/breakpoint trap (core dumped)

This is due to trying to run a chroot, but it seems like it was fixed in docker desktop here https://github.com/docker/for-mac/issues/6973

Additional context

No response