Skip to content

Commit 536e7ea

Browse files
tcconnallyclaude
andauthored
fix(docker): build the musl/Alpine image lean (--no-default-features) (#242)
The Docker image build has been broken since the bundled-embeddings default (#237/#238): on Alpine/musl, `cargo build --release` now pulls in `ort` (ONNX Runtime), whose prebuilt binaries are glibc-only, and the download chain needs `openssl-sys` — which fails on Alpine (`Package 'openssl' not found`). musl + ONNX Runtime is fundamentally incompatible. This Dockerfile is explicitly the static-musl binary for the Firecracker microVM sandbox, so the lean build is the correct artifact here: build with `--no-default-features` (no bundled embeddings), restoring the pre-#238 feature set. FTS5 keyword recall works out of the box; dense/hybrid can use an external embedder. A semantic-search-by-default image would need a glibc base (follow-up). Also COPY build.rs (added in #238; Cargo now requires it to be present even when the model-fetch path is gated off under --no-default-features). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5575ca4 commit 536e7ea

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

Dockerfile

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
# Glama-compatible Dockerfile for Mimir
2-
# Builds a static musl binary for Firecracker microVM sandbox execution
2+
# Builds a static musl binary for Firecracker microVM sandbox execution.
3+
#
4+
# This is the LEAN build (--no-default-features): no bundled ONNX embeddings.
5+
# The bundled-embeddings default (#237) links ONNX Runtime via `ort`, whose
6+
# prebuilt binaries are glibc-only and don't work on Alpine/musl (and the
7+
# download path pulls in openssl-sys, absent here). A single static musl binary
8+
# is the right artifact for the Firecracker sandbox; FTS5 keyword recall works
9+
# out of the box, and dense/hybrid search can use an external embedder. For a
10+
# semantic-search-by-default image, use a glibc base (see issue/roadmap).
311
FROM rust:1.96-alpine AS builder
412
RUN apk add --no-cache musl-dev sqlite-dev
513
WORKDIR /app
614
COPY Cargo.toml Cargo.lock ./
715
COPY src/ ./src/
8-
RUN cargo build --release && strip target/release/mimir
16+
COPY build.rs ./
17+
RUN cargo build --release --no-default-features && strip target/release/mimir
918

1019
FROM alpine:3.21
1120
RUN apk add --no-cache sqlite-libs

0 commit comments

Comments
 (0)