Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
try: docker
Browse files Browse the repository at this point in the history
jerrita committed Apr 12, 2024

Verified

This commit was signed with the committer’s verified signature.
fpapon François Papon
1 parent 7235f65 commit 7a1e5c0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM messense/rust-musl-cross:x86_64-musl as builder-amd64
FROM messense/rust-musl-cross:aarch64-musl as builder-arm64
FROM --platform=linux/amd64 messense/rust-musl-cross:x86_64-musl as builder-amd64
FROM --platform=linux/amd64 messense/rust-musl-cross:aarch64-musl as builder-arm64

FROM --platform=linux/amd64 builder-${TARGETARCH} as builder
WORKDIR /usr/src/peerban
COPY . .
RUN cargo build --profile opt \
&& musl-strip target/opt/peerban
&& tree target \
&& musl-strip target/*/opt/peerban

FROM scratch
COPY --from=builder /usr/src/peerban/target/opt/peerban /
COPY --from=builder /usr/src/peerban/target/*/opt/peerban /
CMD ["/peerban"]

0 comments on commit 7a1e5c0

Please sign in to comment.