[GH-ISSUE #557] [Bug] Dockerfile.lite fails on CPU-only hosts: onnxruntime-node CUDA download during pnpm install #254

Closed
opened 2026-10-20 17:26:50 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Gunterlie on GitHub (May 8, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/557

Originally assigned to: @cha1latte on GitHub.

## Summary
`Dockerfile.lite` fails to build on CPU-only hosts because `onnxruntime-node` 
postinstall attempts to download CUDA libraries from nuget.org, which fails on 
hardware without GPU support.

## Expected behavior
`Dockerfile.lite` should build successfully on CPU-only hardware since the Lite 
image explicitly advertises removing `onnxruntime-node` and local model support.

## Actual behavior
Build fails at Stage 1 `pnpm install --frozen-lockfile` with:

onnxruntime-node postinstall: Downloading https://api.nuget.org/v3-flatcontainer/microsoft.ml.onnxruntime.gpu.linux/...
onnxruntime-node postinstall: Failed
ELIFECYCLE Command failed.


## Steps to reproduce
1. Clone the repository on a CPU-only host
2. Run `docker build -f Dockerfile.lite -t marinara-engine:lite .`
3. Build fails at Dockerfile.lite:34 during `pnpm install --frozen-lockfile`

## Environment
- Marinara Engine version: latest main
- Install type: docker
- OS + version: Debian 12 (LXC on Proxmox)
- Hardware: Intel J5005 (no GPU)

## Logs, screenshots, or video

Dockerfile.lite:34

33 | # Install all dependencies (including dev for building)
34 | >>> RUN --mount=type=cache,target=/app/.pnpm-store
35 | >>> pnpm install --frozen-lockfile

ERROR: failed to build: failed to solve: process "/bin/sh -c pnpm install
--frozen-lockfile" did not complete successfully: exit code: 1


## Additional context
**Workaround:** Patch Stage 1 to use `--ignore-scripts` and manually trigger 
sharp/esbuild postinstall:
```dockerfile
RUN --mount=type=cache,target=/app/.pnpm-store \
    pnpm install --frozen-lockfile --ignore-scripts && \
    node node_modules/sharp/install/check.js || true && \
    node node_modules/esbuild/install.js || true

Suggested fix: Move onnxruntime-node, onnxruntime-web, and
@huggingface/transformers to optionalDependencies in
packages/server/package.json so the Lite build can use --no-optional cleanly.

Note: Stage 2 already has a rm -rf block to remove onnxruntime after install,
but the build never reaches it because Stage 1 fails first.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Gunterlie on GitHub (May 8, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/557 Originally assigned to: @cha1latte on GitHub. ```markdown ## Summary `Dockerfile.lite` fails to build on CPU-only hosts because `onnxruntime-node` postinstall attempts to download CUDA libraries from nuget.org, which fails on hardware without GPU support. ## Expected behavior `Dockerfile.lite` should build successfully on CPU-only hardware since the Lite image explicitly advertises removing `onnxruntime-node` and local model support. ## Actual behavior Build fails at Stage 1 `pnpm install --frozen-lockfile` with: ``` onnxruntime-node postinstall: Downloading https://api.nuget.org/v3-flatcontainer/microsoft.ml.onnxruntime.gpu.linux/... onnxruntime-node postinstall: Failed ELIFECYCLE Command failed. ``` ## Steps to reproduce 1. Clone the repository on a CPU-only host 2. Run `docker build -f Dockerfile.lite -t marinara-engine:lite .` 3. Build fails at Dockerfile.lite:34 during `pnpm install --frozen-lockfile` ## Environment - Marinara Engine version: latest main - Install type: docker - OS + version: Debian 12 (LXC on Proxmox) - Hardware: Intel J5005 (no GPU) ## Logs, screenshots, or video ``` Dockerfile.lite:34 -------------------- 33 | # Install all dependencies (including dev for building) 34 | >>> RUN --mount=type=cache,target=/app/.pnpm-store \ 35 | >>> pnpm install --frozen-lockfile -------------------- ERROR: failed to build: failed to solve: process "/bin/sh -c pnpm install --frozen-lockfile" did not complete successfully: exit code: 1 ``` ## Additional context **Workaround:** Patch Stage 1 to use `--ignore-scripts` and manually trigger sharp/esbuild postinstall: ```dockerfile RUN --mount=type=cache,target=/app/.pnpm-store \ pnpm install --frozen-lockfile --ignore-scripts && \ node node_modules/sharp/install/check.js || true && \ node node_modules/esbuild/install.js || true ``` **Suggested fix:** Move `onnxruntime-node`, `onnxruntime-web`, and `@huggingface/transformers` to `optionalDependencies` in `packages/server/package.json` so the Lite build can use `--no-optional` cleanly. Note: Stage 2 already has a `rm -rf` block to remove onnxruntime after install, but the build never reaches it because Stage 1 fails first. ## Template check - [ ] I DID NOT read this template and provide the requested details. ```
bsakaguchi 2026-10-20 17:26:50 +07:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#254
No description provided.