default: 19.03 IMAGE_NAME := shnee/dind DOCKER_VERSION = "" DATE := $(shell date +%F) SHORT_COMMIT_HASH := $(shell git log -1 --format=%h) UNIQUE_TAG = $(DOCKER_VERSION)-$(DATE)-$(SHORT_COMMIT_HASH) # When using 20.10 there is an issue when running on hosts with older versions # of docker, runc, and libseccomp. See # https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0#faccessat2 # for info on the issue. So to avoid the bug we're using an older version, # 19.03. build: 19.03 # TODO See if we can keep this makefile generic and have an include directory # for specific stuff. 19.03: 19.03-vars docker-build 19.03-clean: 19.03-vars docker-rm 19.03-vars: $(eval DOCKER_VERSION = 19.03) $(eval DOCKER_TAG = 19.03) docker-build: docker build . \ -t $(IMAGE_NAME):$(DOCKER_TAG) clean: clean-all clean-all: 19.03-clean docker-rm: docker rmi $(IMAGE_NAME):$(DOCKER_TAG) help: @echo TODO REM do me. .PHONY: 19.03 19.03-clean 19.03-vars .PHONY: default build tag clean clean-all docker-rm help