monzo-ingestion/Dockerfile
Joshua Coles c86a79b46e
Some checks failed
Build and Publish / Build and Test (push) Failing after 2m12s
Take 3
2024-10-16 13:04:59 +01:00

17 lines
602 B
Docker

FROM busybox as platform_determiner
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=platform_determiner /usr/local/bin/${BINARY_NAME} /usr/local/bin/${BINARY_NAME}
ENTRYPOINT ["/usr/local/bin/${BINARY_NAME}"]