| 1 |
# Copyright (C) 2024 Manu Garg. |
| 2 |
# Author: Manu Garg <[email protected]> |
| 3 |
# |
| 4 |
# Makefile for pacparser docker image. |
| 5 |
-include version.mk |
| 6 |
|
| 7 |
VERSION ?= $(shell git describe --always --tags --candidate=100) |
| 8 |
|
| 9 |
GIT_TAG := $(shell git describe --exact-match --exclude tip --tags HEAD 2>/dev/null || /bin/true) |
| 10 |
GIT_COMMIT = $(strip $(shell git rev-parse --short HEAD)) |
| 11 |
|
| 12 |
DOCKER_IMAGE ?= manugarg/pactester |
| 13 |
ifeq "$(GIT_TAG)" "" |
| 14 |
DOCKER_TAGS := -t $(DOCKER_IMAGE):master -t $(DOCKER_IMAGE):main |
| 15 |
else |
| 16 |
DOCKER_TAGS := -t $(DOCKER_IMAGE):$(GIT_TAG) -t $(DOCKER_IMAGE):latest |
| 17 |
endif |
| 18 |
|
| 19 |
docker_multiarch: Dockerfile |
| 20 |
docker buildx build --push \ |
| 21 |
--build-arg BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \ |
| 22 |
--build-arg VERSION=$(VERSION) \ |
| 23 |
--build-arg VCS_REF=$(GIT_COMMIT) \ |
| 24 |
--platform linux/amd64,linux/arm64,linux/arm/v7 \ |
| 25 |
$(DOCKER_TAGS) . |
| 26 |
|