Get target arch from docker build automatically

This commit is contained in:
ViViDboarder 2021-06-15 10:41:57 -07:00
parent b710065f56
commit 7d0ff070ec
2 changed files with 5 additions and 6 deletions

View File

@ -1,20 +1,19 @@
ARG REPO=library
FROM ${REPO}/alpine:3.12
LABEL maintainer="ViViDboarder <vividboarder@gmail.com>"
ARG TARGETARCH
RUN apk add --no-cache curl=~7 bash=~5
ARG ARCH=amd64
ARG RCLONE_VERSION=v1.55.1
COPY ./scripts/install_rclone.sh /scripts/
RUN /scripts/install_rclone.sh "$RCLONE_VERSION" "$ARCH"
RUN /scripts/install_rclone.sh "$RCLONE_VERSION" "$TARGETARCH"
ARG RESTIC_VERSION=0.12.0
COPY ./scripts/install_restic.sh /scripts/
RUN /scripts/install_restic.sh "$RESTIC_VERSION" "$ARCH"
RUN /scripts/install_restic.sh "$RESTIC_VERSION" "$TARGETARCH"
# Set some default environment variables
ENV BACKUP_DEST="/backups"

View File

@ -15,7 +15,7 @@ build-x86:
.PHONY: build-arm
build-arm:
docker build --build-arg REPO=arm32v7 --build-arg ARCH=arm -f ./Dockerfile -t $(DOCKER_TAG)-arm .
docker build --build-arg REPO=arm32v7 --build-arg TARGETARCH=arm -f ./Dockerfile -t $(DOCKER_TAG)-arm .
.PHONY: build-all
build-all: build-x86 build-arm