# syntax=docker/dockerfile:1.6
ARG ALPINE_VERSION=3.20
ARG BUILDPLATFORM
ARG TARGETPLATFORM
FROM alpine:${ALPINE_VERSION}
ARG TARGETPLATFORM
RUN apk add --no-cache ca-certificates
COPY dist/ /dist/
RUN case "$TARGETPLATFORM" in \
"linux/arm64") echo "aarch64-unknown-linux-musl" > rust_target.txt ;; \
"linux/amd64") echo "x86_64-unknown-linux-musl" > rust_target.txt ;; \
*) exit 1 ;; \
esac
RUN set -eux; \
mv "/dist/diff-coverage-$(cat rust_target.txt)" /usr/local/bin/diff-coverage; \
chmod +x /usr/local/bin/diff-coverage; \
rm -rf /dist rust_target.txt
ENTRYPOINT ["diff-coverage"]