From 7d0ff070ece7d61b2a048a815aee6e2cad388d8b Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Tue, 15 Jun 2021 10:41:57 -0700 Subject: [PATCH] Get target arch from docker build automatically --- Dockerfile | 9 ++++----- Makefile | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index d83c4b1..431be1b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,19 @@ ARG REPO=library FROM ${REPO}/alpine:3.12 -LABEL maintainer="ViViDboarder " + +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" diff --git a/Makefile b/Makefile index 3f33eb3..570f77a 100644 --- a/Makefile +++ b/Makefile @@ -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