Add entrypoint

This commit is contained in:
Valentin Brandl 2019-04-16 18:02:01 +02:00
parent eb9c3ac31c
commit 96b5811397
No known key found for this signature in database
GPG Key ID: 30D341DD34118D7D

View File

@ -2,15 +2,12 @@ FROM ekidd/rust-musl-builder:stable as builder
# create new cargo project # create new cargo project
RUN USER=rust cargo init --bin RUN USER=rust cargo init --bin
# set last modified date to 1970-01-01 to prevent caching issues later on
# RUN touch -t 197001010000.00 src/main.rs
# copy build config # copy build config
COPY ./Cargo.lock ./Cargo.lock COPY ./Cargo.lock ./Cargo.lock
COPY ./Cargo.toml ./Cargo.toml COPY ./Cargo.toml ./Cargo.toml
# build to cache dependencies # build to cache dependencies
RUN cargo build --release RUN cargo build --release
# RUN ls target/x*/release # delete build cache to prevent caching issues later on
# RUN touch -t 197001010000.00 ./target/x86_64-unknown-linux-musl/release/hoc.d
RUN rm -r ./target/x86_64-unknown-linux-musl/release/.fingerprint/hoc-* RUN rm -r ./target/x86_64-unknown-linux-musl/release/.fingerprint/hoc-*
# copy source code # copy source code
@ -22,3 +19,5 @@ FROM alpine:latest
RUN apk --no-cache add --update git RUN apk --no-cache add --update git
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/hoc /hoc COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/hoc /hoc
ENTRYPOINT ["/hoc"]