2023-09-07 11:53:18 +02:00
|
|
|
# SPDX-FileCopyrightText: 2023 Tobias Schmidl
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
|
|
|
2023-09-07 12:45:46 +02:00
|
|
|
DOCKER := docker
|
|
|
|
BUILDER := ${DOCKER} buildx
|
2023-09-07 12:32:05 +02:00
|
|
|
TAG := git.schmidl.dev/schtobia/buildimage
|
2023-09-07 13:00:07 +02:00
|
|
|
VERSION = $(shell git describe --tags --always --dirty)
|
2023-09-07 11:53:18 +02:00
|
|
|
|
|
|
|
build: dockerfile
|
2023-09-07 13:00:07 +02:00
|
|
|
@${BUILDER} build --build-arg=GIT_COMMIT=$(shell git describe --always) --build-arg=VERSION=${VERSION} --build-arg=TIMESTAMP="$(shell date -u -Iseconds)" -t ${TAG} -t ${TAG}:${VERSION} .
|
2023-09-07 12:45:46 +02:00
|
|
|
|
|
|
|
.PHONY: publish
|
|
|
|
publish: build
|
2023-09-07 13:01:56 +02:00
|
|
|
@${DOCKER} push ${TAG}:latest
|
|
|
|
@${DOCKER} push ${TAG}:${VERSION}
|