mirror of
https://codeberg.org/icewind/log-archiver.git
synced 2026-06-03 17:44:06 +02:00
22 lines
469 B
Docker
22 lines
469 B
Docker
FROM ekidd/rust-musl-builder AS build
|
|
|
|
COPY Cargo.toml Cargo.lock ./
|
|
|
|
# Build with a dummy main to pre-build dependencies
|
|
RUN mkdir src && \
|
|
echo "fn main(){}" > src/main.rs && \
|
|
cargo build --release && \
|
|
rm -r src
|
|
|
|
COPY src/ ./src/
|
|
COPY sqlx-data.json ./
|
|
RUN sudo chown -R rust:rust . && \
|
|
touch src/main.rs
|
|
|
|
RUN cargo build --release
|
|
|
|
FROM scratch
|
|
|
|
COPY --from=build /home/rust/src/target/x86_64-unknown-linux-musl/release/log-archiver /
|
|
|
|
CMD ["/log-archiver"]
|