added the version to image

This commit is contained in:
Tobias Schmidl 2023-09-07 13:00:07 +02:00
parent 826e225077
commit 8406243761

View file

@ -5,10 +5,11 @@
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=$(shell git describe --tags --always --dirty) --build-arg=TIMESTAMP="$(shell date -u -Iseconds)" -t ${TAG} .
@${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}
@${DOCKER} push ${TAG}:latest ${TAG}:${VERSION}