mirror of
https://codeberg.org/icewind/taspromto.git
synced 2026-06-03 16:44:11 +02:00
build using official image
This commit is contained in:
parent
b6624fd763
commit
f6602539c3
1 changed files with 7 additions and 6 deletions
13
Dockerfile
13
Dockerfile
|
|
@ -1,21 +1,22 @@
|
||||||
FROM ekidd/rust-musl-builder AS build
|
FROM rust:alpine AS build
|
||||||
|
|
||||||
COPY Cargo.toml Cargo.lock ./
|
COPY Cargo.toml Cargo.lock ./
|
||||||
|
|
||||||
# Build with a dummy main to pre-build dependencies
|
# Build with a dummy main to pre-build dependencies
|
||||||
RUN mkdir src && \
|
RUN apk add --no-cache alpine-sdk && \
|
||||||
|
mkdir src && \
|
||||||
echo "fn main(){}" > src/main.rs && \
|
echo "fn main(){}" > src/main.rs && \
|
||||||
cargo build --release && \
|
cargo build --release --target x86_64-unknown-linux-musl && \
|
||||||
rm -r src
|
rm -r src
|
||||||
|
|
||||||
COPY src/* ./src/
|
COPY src/* ./src/
|
||||||
RUN sudo chown -R rust:rust . && touch src/main.rs
|
|
||||||
|
|
||||||
RUN cargo build --release
|
RUN touch src/main.rs && \
|
||||||
|
cargo build --release --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
FROM scratch
|
FROM scratch
|
||||||
|
|
||||||
COPY --from=build /home/rust/src/target/x86_64-unknown-linux-musl/release/taspromto /
|
COPY --from=build /target/x86_64-unknown-linux-musl/release/taspromto /
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
CMD ["/taspromto"]
|
CMD ["/taspromto"]
|
||||||
Loading…
Add table
Add a link
Reference in a new issue