Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable build in both amd64 and arm64 #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
FROM clux/muslrust:stable as builder
FROM clux/muslrust:stable AS builder

ARG TARGETPLATFORM
ARG BUILDPLATFORM

RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM" > /log

ADD --chown=rust:rust . ./
RUN cargo build --release

FROM alpine:latest
ARG APP_USER=gravel
RUN addgroup -S $APP_USER && adduser -S -g $APP_USER $APP_USER
COPY --from=builder ./volume/target/x86_64-unknown-linux-musl/release/gravel-gateway /usr/bin/gravel-gateway

# COPY --from=builder ./volume/target/x86_64-unknown-linux-musl/release/gravel-gateway /usr/bin/gravel-gateway
# COPY --from=builder ./volume/target/aarch64-unknown-linux-musl/release/gravel-gateway /usr/bin/gravel-gateway
# to handle differenc RUST_ARCH use '*'
COPY --from=builder ./volume/target/*-unknown-linux-musl/release/gravel-gateway /usr/bin/gravel-gateway

RUN chown -R $APP_USER:$APP_USER /usr/bin/gravel-gateway
USER $APP_USER
EXPOSE 4278
Expand Down