buildimage/Makefile

15 lines
526 B
Makefile

# SPDX-FileCopyrightText: 2023 Tobias Schmidl
#
# SPDX-License-Identifier: AGPL-3.0-or-later
DOCKER := docker
BUILDER := ${DOCKER} buildx
TAG := git.schmidl.dev/schtobia/buildimage
VERSION = $(shell git describe --tags --always --dirty)
build: dockerfile
@${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} .
.PHONY: publish
publish: build
@${DOCKER} push ${TAG}:latest ${TAG}:${VERSION}