FROM rust:alpine as builder RUN apk add --no-cache musl-dev WORKDIR / RUN USER=root cargo new app COPY Cargo.toml Cargo.lock /app WORKDIR /app RUN cargo build --release COPY src /app/src RUN touch /app/src/main.rs RUN cargo build --release FROM scratch COPY --from=builder /app/target/release/tchoutchou /tchoutchou CMD ["/tchoutchou"]