ping/rust/Dockerfile: Build in debug mode instead of release mode (#50)

This commit is contained in:
Max Inden 2022-11-04 18:05:27 +01:00 committed by GitHub
parent 3d51093f23
commit b97b36aa27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,7 +14,7 @@ RUN cd ./plan/ && \
cargo update --dry-run && \
cargo fetch && \
# use a default feature to rely on docker caching.
cargo build --release --features "libp2pv0450"
cargo build --features "libp2pv0450"
ARG CARGO_PATCH=""
ARG CARGO_REMOVE=""
@ -28,7 +28,7 @@ RUN cp ./plan/Cargo.toml ./plan/Cargo.lock /tmp/
COPY ./plan/${PLAN_PATH} ./plan
# This is in order to make sure `main.rs`s mtime timestamp is updated to avoid the dummy `main`
# remaining in the release binary.
# remaining in the binary.
# https://github.com/rust-lang/cargo/issues/9598
RUN touch ./plan/src/main.rs
@ -37,10 +37,10 @@ RUN mv /tmp/Cargo.toml /tmp/Cargo.lock ./plan
ARG CARGO_FEATURES=""
RUN cd ./plan/ && \
cargo build --release --features="${CARGO_FEATURES}"
cargo build --features="${CARGO_FEATURES}"
FROM debian:bullseye-slim
COPY --from=builder /usr/src/testplan/plan/target/release/testplan /usr/local/bin/testplan
COPY --from=builder /usr/src/testplan/plan/target/debug/testplan /usr/local/bin/testplan
EXPOSE 6060
ENV RUST_BACKTRACE=1
ENTRYPOINT ["testplan"]