fix(docker): fetch arm64 prisma schema-engine for non_root image - #118
Merged
Conversation
On the Wolfi base, prisma-client-py's platform detection is arch-blind
(binary_platform() -> "debian-openssl-3.0.x" with no CPU arch), so the
build only ever provisioned the amd64 schema-engine. The arm64 image
therefore shipped the arm64 *query* engine (via schema.prisma's "native"
target) but NO arm64 *schema* engine — so `prisma migrate deploy` fails at
boot on arm64 ("Could not find schema-engine binary"), leaving the DB
unmigrated. amd64 (CI, prod) is unaffected.
Name linux-arm64-openssl-3.0.x explicitly in PRISMA_CLI_BINARY_TARGETS so
the build-time (online) fetch pulls the arm64 schema-engine alongside the
debian one. Verified by building --target builder --platform linux/arm64:
schema-engine-linux-arm64-openssl-3.0.x now lands in @prisma/engines and
execs natively (`schema-engine-cli --version` runs on aarch64).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
mateo-di
approved these changes
Jun 22, 2026
3 tasks
Cartofante
pushed a commit
that referenced
this pull request
Jul 14, 2026
Re-add PRISMA_CLI_BINARY_TARGETS to Dockerfile.non_root builder stage to fetch the arm64 schema-engine binary alongside the amd64 one. Without this, prisma migrate deploy fails on Apple Silicon / arm64 hosts because only the amd64 schema-engine is available This restores CARTO PR #118 functionality that was incorrectly dropped during the upstream sync conflict resolution
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The arm64 variant of
litellm-non_rootships the arm64 query engine but no arm64 schema-engine — onlyschema-engine-debian-openssl-3.0.x(amd64). As a result, on Apple-Silicon / arm64 hostsprisma migrate deployfails at boot:litellm boots (the arm64 query engine connects, so queries run) but the DB is never migrated — every
LiteLLM_*table is missing, and any flow that touches them 401/500s. amd64 (CI, prod) is unaffected, which is why this only bites local arm64 dev.Root cause
On the Wolfi base, prisma-client-py's platform detection is arch-blind:
So the build resolves the schema-engine platform to
debian-openssl-3.0.x(the amd64 binary) on both arches. The query engine escapes this only becauseschema.prisma'sbinaryTargetsincludes"native", which resolves the true arch.Fix
Name the arm64 target explicitly in
PRISMA_CLI_BINARY_TARGETS(both build + runtime stages) so the build-time online fetch pulls the arm64 schema-engine alongside the debian one:amd64 is unchanged (debian engine still fetched); the extra arm64 engine on the amd64 image is a few MB of harmless dead weight (could be made arch-aware via
ARG TARGETARCHif preferred — happy to switch).Verification
Built
--target builder --platform linux/arm64with the change and inspected the image:With this, the arm64 image self-migrates on boot (
USE_PRISMA_MIGRATE=true) — no amd64 emulation needed for local dev.🤖 Generated with Claude Code