FROM debian:buster-20210208-slim as builder ARG DEBIAN_FRONTEND=noninteractive ARG TARGETARCH RUN apt update -qq && apt install wget -qqy && rm -rf /var/lib/apt/lists/* ARG VERSION RUN case $TARGETARCH in \ arm) \ wget https://dl.bintray.com/borg-binary-builder/borg-binaries/borg-${VERSION}-armv6 -O /usr/bin/borg \ ;; \ arm64) \ wget https://dl.bintray.com/borg-binary-builder/borg-binaries/borg-${VERSION}-arm64 -O /usr/bin/borg \ ;; \ amd64) \ wget https://github.com/borgbackup/borg/releases/download/${VERSION}/borg-linux64 -O /usr/bin/borg \ ;; \ esac && \ chmod a+x /usr/bin/borg FROM debian:buster-20210208-slim COPY --from=builder /usr/bin/borg /usr/bin/borg