-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from Angelin01/dockerfile
Add Containerfile
- Loading branch information
Showing
3 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM rust:1.74.0-alpine3.18 as builder | ||
|
||
WORKDIR /build | ||
|
||
RUN apk add --no-cache musl-dev=1.2.4-r2 | ||
|
||
COPY .cargo . | ||
COPY Cargo* ./ | ||
|
||
RUN mkdir -p src && \ | ||
touch src/lib.rs && \ | ||
cargo build --release --locked --target=x86_64-unknown-linux-musl | ||
|
||
COPY src src/ | ||
|
||
RUN cargo build --release --locked --target=x86_64-unknown-linux-musl | ||
|
||
FROM alpine:3.18.4 | ||
|
||
WORKDIR /app | ||
|
||
RUN apk add --no-cache tini=0.19.0-r1 | ||
|
||
COPY --from=builder /build/target/x86_64-unknown-linux-musl/release/pod-director . | ||
|
||
ENTRYPOINT ["tini", "--"] | ||
CMD ["./pod-director"] |