@@ -2,8 +2,7 @@ FROM docker.io/library/rust AS builder
|
||||
|
||||
ARG BUILD_MODE=debug
|
||||
|
||||
RUN apt-get update && apt-get install -y musl-tools && apt-get clean
|
||||
RUN rustup target add x86_64-unknown-linux-musl
|
||||
RUN apt-get update && apt-get clean
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -13,11 +12,13 @@ RUN cargo fetch
|
||||
RUN rm -rf src
|
||||
|
||||
COPY src ./src
|
||||
COPY migrations ./migrations
|
||||
COPY .sqlx ./.sqlx
|
||||
|
||||
RUN cargo build --target=x86_64-unknown-linux-musl $(if [ "$BUILD_MODE" = "release" ]; then echo "--release"; else echo ""; fi)
|
||||
RUN mkdir -p build && cp target/x86_64-unknown-linux-musl/$(if [ "$BUILD_MODE" = "release" ]; then echo "release"; else echo "debug"; fi)/glyph build/glyph
|
||||
RUN cargo build $(if [ "$BUILD_MODE" = "release" ]; then echo "--release"; else echo ""; fi)
|
||||
RUN mkdir -p build && cp target/$(if [ "$BUILD_MODE" = "release" ]; then echo "release"; else echo "debug"; fi)/glyph build/glyph
|
||||
|
||||
FROM docker.io/library/alpine
|
||||
FROM docker.io/library/debian:bookworm-slim
|
||||
|
||||
COPY --from=builder /app/build/glyph /usr/local/bin/glyph
|
||||
|
||||
|
Reference in New Issue
Block a user