colima
colima copied to clipboard
Segmentation Fault During vite build in Docker on Colima (Works Outside Docker)
Description
Running vite build inside a Docker container managed by Colima on an Intel Mac results in a segmentation fault. The same build process completes successfully:
-
Outside Docker on the host (Node 20, npm 10)
-
Inside Docker when using Docker Desktop
This suggests a runtime or filesystem-level issue related to Colima’s environment.
Could you please advise if this is a known limitation or if there are any workarounds? I'm happy to provide a full reproducible container configuration and additional trace logs if needed.
Version
colima version 0.8.1 git commit: 96598cc5b64e5e9e1e64891642b91edc8ac49d16 limactl version 1.0.7 qemu-img version 2.12.0(gradle_1.3.0-beta4-81840-g64886e740b)
Operating System
- [x] macOS Intel <= 13 (Ventura)
- [ ] macOS Intel >= 14 (Sonoma)
- [ ] Apple Silicon <= 13 (Ventura)
- [ ] Apple Silicon >= 14 (Sonoma)
- [ ] Linux
Output of colima status
INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: x86_64
INFO[0000] runtime: docker
INFO[0000] mountType: sshfs
INFO[0000] socket: unix:///Users/*
Reproduction Steps
- Clone the repository: https://github.com/tiangolo/full-stack-fastapi-postgresql.git
- Ensure you are on an Intel Mac, using Colima as your Docker backend.
- inside the repository, run
docker-compose up frontend - Observe that the build fails with a segmentation fault during the npm run build step, specifically when Vite transforms index.html.
Expected behaviour
Expected it to be able to build smoothly without segfault error.
Additional context
Additional Observations:
Running npm ci on the host and copying node_modules into the container still results in a segmentation fault.
Switching to Docker Desktop eliminates the issue entirely.
The segmentation fault consistently occurs during Vite's HTML transformation or dependency graph building.
No explicit use of esbuild in the project.
strace Log:
Attaching the final part of strace showing the crash:
pgsql Copy Edit mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x55691c12e000 mprotect(0x55691c120000, 4096, PROT_READ) = 0 --- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x18} --- +++ killed by SIGSEGV (core dumped) +++
Have you tried using VZ rather than Qemu when starting Colima?
@MatthewRyanRead Yes I tried it now, but it also resulted in seg fault error. 18.97 vite v5.4.14 building for production... 19.29 Segmentation fault (core dumped)
failed to solve: process "/bin/sh -c npm run build" did not complete successfully: exit code: 139
@amit11893 For me, moving back to 2CPUs, 4Gib RAM from 4CPUs, 4Gib RAM for the colima VM fixed the 139 issues. I didn't find the root cause, but it might work for you too.