16 lines
321 B
Docker
16 lines
321 B
Docker
FROM rust:alpine as build
|
|
|
|
ENV RUSTFLAGS='-C target-feature=-crt-static'
|
|
|
|
WORKDIR /app
|
|
COPY . .
|
|
RUN apk add --no-cache musl-dev
|
|
RUN cargo install --path . -j $(nproc)
|
|
|
|
FROM alpine:latest
|
|
|
|
COPY --from=build /usr/local/cargo/bin/$REPO_NAME /app/$REPO_NAME
|
|
WORKDIR /app
|
|
RUN apk add --no-cache libgcc
|
|
|
|
CMD ["./${REPO_NAME}"]
|