2023-02-05 14:11:45 +00:00
|
|
|
FROM rust:alpine as builder
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2023-04-14 02:13:41 +00:00
|
|
|
RUN apk add --no-cache musl-dev libssl3 openssl-dev
|
2023-02-05 14:11:45 +00:00
|
|
|
|
2023-04-14 02:13:41 +00:00
|
|
|
# This should fetch the index and cache it. This should reduce the time required of subsequent builds
|
2023-02-05 14:11:45 +00:00
|
|
|
RUN cargo search test
|
|
|
|
|
|
|
|
COPY Cargo.toml Cargo.lock /app/
|
|
|
|
# COPY .cargo /app/.cargo
|
|
|
|
|
|
|
|
COPY src /app/src
|
|
|
|
|
2023-04-14 02:13:41 +00:00
|
|
|
|
2023-02-05 14:11:45 +00:00
|
|
|
RUN cargo build --release
|
|
|
|
|
|
|
|
FROM alpine
|
|
|
|
|
2023-04-14 02:13:41 +00:00
|
|
|
RUN apk add --no-cache libssl3
|
2023-02-05 14:11:45 +00:00
|
|
|
COPY --from=builder /app/target/release/rustocat /usr/bin/rustocat
|
|
|
|
|
2023-04-14 02:13:41 +00:00
|
|
|
ENTRYPOINT ["/bin/sh"]
|
|
|
|
CMD [ "-c", "/usr/bin/rustocat" ]
|
|
|
|
|
2023-02-05 14:11:45 +00:00
|
|
|
|