fix(docker): switch to glibc to fix libSQL segfault on restart - #1930
Conversation
The musl-linked binary segfaults when reopening an existing libSQL database after container restart. The bundled SQLite C code in libsql-ffi has threading/mmap issues when statically linked against musl. Switching build and runtime to Debian/glibc resolves this. Tested on sysbox with multiple restart cycles — no segfault. [skip-regression-check]
There was a problem hiding this comment.
Code Review
This pull request migrates the Dockerfile from Alpine to Debian (bookworm) to resolve threading issues with libSQL/SQLite when statically linked against musl. The review identifies two potential failures: the removal of cmake from the build stage which is likely required for dependencies like wasm-tools, and the use of the adduser command in the debian:bookworm-slim runtime image which may not be available. Both issues would likely result in build or runtime errors.
There was a problem hiding this comment.
Pull request overview
Switches the production Docker image from Alpine/musl to Debian/glibc to avoid libSQL-related segfaults after container restarts (reopening an existing DB), aligning the container runtime with a glibc-linked build.
Changes:
- Updated build stages to use
rust:1.92-bookworminstead of Alpine/musl. - Updated runtime stage to
debian:bookworm-slimand installedca-certificatesviaapt. - Adjusted user creation to Debian-compatible tooling.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
The musl-linked binary segfaults when reopening an existing libSQL database after container restart. The bundled SQLite C code in libsql-ffi has threading/mmap issues when statically linked against musl. Switching build and runtime to Debian/glibc resolves this. Tested on sysbox with multiple restart cycles — no segfault. [skip-regression-check]
…rai#1930) The musl-linked binary segfaults when reopening an existing libSQL database after container restart. The bundled SQLite C code in libsql-ffi has threading/mmap issues when statically linked against musl. Switching build and runtime to Debian/glibc resolves this. Tested on sysbox with multiple restart cycles — no segfault. [skip-regression-check]
Summary
libsql-ffihas threading/mmap issues when statically linked against muslTest plan
ironclaw --version, gateway, Docker daemon, all functional