monzo-ingestion/Dockerfile
Joshua Coles e739d5ea5b
All checks were successful
Build and Publish / Build and Test (push) Successful in 2m19s
Turns out you just can't use build args in the entrypoint... why... who knows
2024-10-16 13:39:46 +01:00

15 lines
599 B
Docker

FROM busybox AS platform_determiner
ARG TARGETPLATFORM
ARG BINARY_NAME
COPY /target /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/bin/monzo-ingestion" && chmod +x "/usr/bin/monzo-ingestion"
FROM --platform=$TARGETPLATFORM debian:bullseye-slim
COPY --from=platform_determiner /usr/bin/monzo-ingestion /usr/local/bin/monzo-ingestion
ENTRYPOINT ["/usr/local/bin/monzo-ingestion"]