Make RESTIC_VERSION an argument

This commit is contained in:
2023-04-06 12:46:38 +02:00
parent 96377203b0
commit 1a99bba3c5
2 changed files with 4 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
ORG ?= genunix
VERSION = $(shell grep "ENV RESTIC_VERSION" Dockerfile | awk '{print $$3}')
VERSION ?= $(shell grep "ARG RESTIC_VERSION" Dockerfile | cut -d = -f 2)
PLATFORMS ?= linux/arm/v7,linux/arm64/v8,linux/amd64
build-all: print-version build-version build-latest
@@ -8,7 +8,7 @@ print-version:
@echo "Building $(ORG)/restic:$(VERSION) for $(PLATFORMS)"
build-version:
docker buildx build --push --platform $(PLATFORMS) --tag $(ORG)/restic:$(VERSION) .
docker buildx build --build-arg RESTIC_VERSION=$(VERSION) --push --platform $(PLATFORMS) --tag $(ORG)/restic:$(VERSION) .
build-latest:
docker buildx build --push --platform $(PLATFORMS) --tag $(ORG)/restic:latest .
docker buildx build --build-arg RESTIC_VERSION=$(VERSION) --push --platform $(PLATFORMS) --tag $(ORG)/restic:latest .