chore(docker): update Dockerfile about Rust edition

This commit is contained in:
Orhun Parmaksız 2021-11-07 16:52:08 +03:00
parent 6b3914a54e
commit b12ff1f579
No known key found for this signature in database
GPG key ID: F83424824B3E4B90

View file

@ -1,11 +1,15 @@
FROM ekidd/rust-musl-builder:latest as builder
WORKDIR /home/rust/src
COPY Cargo.toml Cargo.toml
# https://github.com/emk/rust-musl-builder/issues/130
RUN sed -i "s|edition = \"2021\"|edition = \"2018\"|" Cargo.toml
RUN mkdir -p src/
RUN echo "fn main() {println!(\"failed to build\")}" > src/main.rs
RUN cargo build --release
RUN rm -f target/release/deps/rustypaste*
COPY . .
# https://github.com/emk/rust-musl-builder/issues/130
RUN sed -i "s|edition = \"2021\"|edition = \"2018\"|" Cargo.toml
RUN cargo build --locked --release
RUN mkdir -p build-out/
RUN cp target/x86_64-unknown-linux-musl/release/rustypaste build-out/