Using Git Version on a Node Project in a Makefile for Docker Build
# This will output something similar to `git describe --always --long`.
# This is being done because we need the build to happen before we are able to reliably tag a commit (due to squash and merge).
VERSION ?= "v$(shell node -e 'console.log(require("./package.json").version)')-g$(shell git rev-parse --short HEAD)"
.PHONY: docker-build
	docker build -t $(IMAGE):$(VERSION) .
Updated Last:2023-01-05T22:32:04.000Z