Fix alpine build

This commit is contained in:
ViViDboarder 2021-07-23 15:52:34 -07:00
parent 5682eab8dc
commit 21a50a1ee0
1 changed files with 4 additions and 3 deletions

View File

@ -4,13 +4,14 @@ WORKDIR /home/rust/src
# Cache build deps # Cache build deps
RUN USER=rust cargo init RUN USER=rust cargo init
COPY Cargo.toml Cargo.lock ./ COPY --chown=rust:rust Cargo.toml Cargo.lock ./
RUN cargo build --locked --release && \ RUN cargo build --locked --release && \
rm src/*.rs rm src/*.rs
COPY --chown=rust:rust ./src ./src COPY --chown=rust:rust ./src ./src
RUN touch ./src/main.rs && \ RUN USER=rust touch ./src/main.rs
cargo build --release # hadolint ignore=DL3059
RUN cargo build --release
FROM alpine:3 FROM alpine:3
RUN apk --no-cache add ca-certificates=20191127-r5 RUN apk --no-cache add ca-certificates=20191127-r5