2023-02-04 11:51:14 +00:00
|
|
|
FROM rust:alpine
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
2023-02-09 10:57:29 +00:00
|
|
|
RUN apk update && apk add pkgconfig openssl-dev musl-dev
|
2023-02-04 11:51:14 +00:00
|
|
|
|
2023-02-09 10:59:39 +00:00
|
|
|
COPY Cargo.toml .
|
|
|
|
COPY dummy.rs .
|
|
|
|
|
|
|
|
# Cache building
|
|
|
|
RUN sed -i 's|src/main.rs|dummy.rs|' Cargo.toml
|
2023-02-04 11:51:14 +00:00
|
|
|
RUN cargo build --release
|
2023-02-09 10:59:39 +00:00
|
|
|
RUN cargo build
|
|
|
|
RUN sed -i 's|dummy.rs|src/main.rs|' Cargo.toml
|
|
|
|
|
|
|
|
# Building normally
|
|
|
|
COPY src src
|
|
|
|
RUN cargo build
|
2023-02-04 11:51:14 +00:00
|
|
|
RUN cargo install --path .
|
|
|
|
|
|
|
|
ENTRYPOINT [ "phuncache" ]
|