Skip to content

Commit

Permalink
remove MYAPPNAME variable
Browse files Browse the repository at this point in the history
  • Loading branch information
amaurel committed Mar 18, 2023
1 parent 57020a6 commit 853b406
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ RUN cargo fetch
FROM builder-dependencies as builder
ENV MYAPPNAME=ondo-server
ENV RUSTFLAGS="-C instrument-coverage"
ENV LLVM_PROFILE_FILE="local-coverage/${MYAPPNAME}.profraw"
ENV LLVM_PROFILE_FILE="local-coverage/ondo-server.profraw"
COPY . .

FROM builder as checker
Expand All @@ -26,18 +26,18 @@ FROM checker as test
RUN cargo test

FROM test as coverage
RUN $RUSTUPBIN/llvm-profdata merge -sparse local-coverage/${MYAPPNAME}.profraw -o local-coverage/${MYAPPNAME}.profdata
RUN $RUSTUPBIN/llvm-profdata merge -sparse local-coverage/ondo-server.profraw -o local-coverage/ondo-server.profdata
CMD cp -r local-coverage/* coverage/ &&\
$RUSTUPBIN/llvm-cov report -Xdemangler=$RUSTFILT target/debug/${MYAPPNAME} -instr-profile=coverage/${MYAPPNAME}.profdata
$RUSTUPBIN/llvm-cov report -Xdemangler=$RUSTFILT target/debug/ondo-server -instr-profile=coverage/ondo-server.profdata

FROM test as dev-builder
RUN cargo build

FROM debian:buster-slim as dev
# RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*
RUN apt-get update && rm -rf /var/lib/apt/lists/*
COPY --from=dev-builder /usr/src/myapp/target/debug/${MYAPPNAME} /usr/local/bin/${MYAPPNAME}
CMD ["${MYAPPNAME}"]
COPY --from=dev-builder /usr/src/myapp/target/debug/ondo-server /usr/local/bin/ondo-server
CMD ["ondo-server"]

FROM test as release-builder
ARG VERSION
Expand All @@ -55,8 +55,6 @@ RUN echo RUSTFLAGS=$RUSTFLAGS

RUN cargo build --release

FROM debian:buster-slim as release
# RUN apt-get update && apt-get install -y extra-runtime-dependencies && rm -rf /var/lib/apt/lists/*
# RUN apt-get update && rm -rf /var/lib/apt/lists/*
COPY --from=release-builder /usr/src/myapp/target/release/${MYAPPNAME} /usr/local/bin/${MYAPPNAME}
CMD ["${MYAPPNAME}"]
FROM debian:bullseye-slim as release
COPY --from=release-builder /usr/src/myapp/target/release/ondo-server /usr/local/bin/ondo-server
CMD ["ondo-server"]

0 comments on commit 853b406

Please sign in to comment.