buildimage/Makefile

18 lines
735 B
Makefile
Raw Permalink Normal View History

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
URL:= https://${TAG}
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
@${BUILDER} build --label org.opencontainers.image.revision=$(shell git describe --always) --label org.opencontainers.image.version=${VERSION} --label org.opencontainers.image.created="$(shell date -u -Iseconds)" --label org.opencontainers.image.source=https://${TAG}.git --label org.opencontainers.image.url=https://${TAG} -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}