All checks were successful
Build and Publish / Build and Test (push) Successful in 10m32s
17 lines
581 B
Docker
17 lines
581 B
Docker
FROM --platform=$BUILDPLATFORM debian:bullseye-slim AS builder
|
|
ARG TARGETPLATFORM
|
|
ARG BINARY_NAME
|
|
WORKDIR /app
|
|
COPY /target /app/target
|
|
RUN case "$TARGETPLATFORM" in \
|
|
"linux/amd64") BINARY_PATH="target/release/${BINARY_NAME}" ;; \
|
|
"linux/arm64") BINARY_PATH="target/aarch64-unknown-linux-musl/release/${BINARY_NAME}" ;; \
|
|
*) exit 1 ;; \
|
|
esac && \
|
|
mv "$BINARY_PATH" /usr/local/bin/${BINARY_NAME}
|
|
|
|
FROM --platform=$TARGETPLATFORM debian:bullseye-slim
|
|
ARG BINARY_NAME
|
|
COPY --from=builder /usr/local/bin/${BINARY_NAME} /usr/local/bin/
|
|
CMD ["${BINARY_NAME}"]
|