rustic/Dockerfile
Timtor 62f608746e
build(docker): support arm64 docker image (#1351)
This PR create a new building target `aarch64-unknonw-linux-musl`, as
`aarch64-unknonw-linux-gnu` is not competible with the docker base image
`scratch`.

Follows the current step, the arm64 docker image will be built after
Github release.
2024-11-11 18:44:35 +00:00

19 lines
622 B
Docker

FROM alpine AS builder
ARG RUSTIC_VERSION
ARG TARGETARCH
RUN if [ "$TARGETARCH" = "amd64" ]; then \
ASSET="rustic-${RUSTIC_VERSION}-x86_64-unknown-linux-musl.tar.gz";\
elif [ "$TARGETARCH" = "arm64" ]; then \
ASSET="rustic-${RUSTIC_VERSION}-aarch64-unknown-linux-musl.tar.gz"; \
fi; \
wget https://github.com/rustic-rs/rustic/releases/download/${RUSTIC_VERSION}/${ASSET} && \
tar -xzf ${ASSET} && \
mkdir /etc_files && \
touch /etc_files/passwd && \
touch /etc_files/group
FROM scratch
COPY --from=builder /rustic /
COPY --from=builder /etc_files/ /etc/
ENTRYPOINT ["/rustic"]