mirror of
https://codeberg.org/icewind/log-normalizer.git
synced 2026-06-03 13:54:11 +02:00
optimize docker build
This commit is contained in:
parent
87ff3a084b
commit
d6fa28954e
1 changed files with 13 additions and 3 deletions
16
Dockerfile
16
Dockerfile
|
|
@ -1,9 +1,19 @@
|
|||
FROM ekidd/rust-musl-builder AS build
|
||||
|
||||
ADD . ./
|
||||
RUN sudo chown -R rust:rust .
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
|
||||
RUN cargo build --release
|
||||
# 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 && \
|
||||
cargo build --release
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue