20 lines
502 B
Docker
20 lines
502 B
Docker
|
|
ARG ALPINE_VERSION=latest
|
||
|
|
FROM alpine:$ALPINE_VERSION as builder
|
||
|
|
|
||
|
|
COPY Cargo.lock /usr/src/
|
||
|
|
COPY Cargo.toml /usr/src/
|
||
|
|
COPY src/ /usr/src/src/
|
||
|
|
|
||
|
|
WORKDIR /usr/src
|
||
|
|
|
||
|
|
RUN apk add --no-cache rustup build-base && \
|
||
|
|
rustup-init -qy --profile=minimal && \
|
||
|
|
source "$HOME/.cargo/env" && \
|
||
|
|
cargo build --release --target=x86_64-unknown-linux-musl
|
||
|
|
|
||
|
|
FROM alpine:$ALPINE_VERSION
|
||
|
|
|
||
|
|
COPY --from=builder /usr/src/target/x86_64-unknown-linux-musl/release/web-template /usr/bin/
|
||
|
|
|
||
|
|
CMD [ "/usr/bin/web-template" ]
|