Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

prisma generate panics when building docker image on alpine base #466

@StoicDeveloper

Description

@StoicDeveloper

When attempting to generate prisma.rs while building an alpine-based image, the binary panics with an OS "No such file or directory" error, which occurs on the prisma_cli.rs cmd.output().unwrap() call, as detailed in the stack trace below.

The build works fine when using a debian base image, but I wanted to use alpine since the resulting image size is 10x larger with debian.

Here is the relevant dockerfile stage:

FROM rust:alpine AS builder-alpine
RUN rustup default nightly
RUN apk add --update musl-dev libressl-dev
WORKDIR /app
COPY ./src-server .
RUN RUST_BACKTRACE=1 cargo prisma generate
RUN cargo build --release

The build output indicating the failing line:

------                                         
Dockerfile:28                                  
--------------------                           
  26 |     WORKDIR /app
  27 |     COPY ./src-server .
  28 | >>> RUN RUST_BACKTRACE=1 cargo prisma generate                                          
  29 |     RUN cargo build --release 
  30 |     # RUN apk add bash curl
--------------------                           
ERROR: failed to solve: process "/bin/sh -c RUST_BACKTRACE=1 cargo prisma generate" did not complete successfully: exit code: 101

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions