monzo-ingestion/Dockerfile
Joshua Coles a60d0effff
All checks were successful
Build and Publish / Build and Test (push) Successful in 11m0s
Remove quotes around binary name
Maybe this will work?
2024-10-15 22:46:28 +01:00

17 lines
579 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}]