Files
backup-2/ci/build-image/example/Makefile
T
2020-07-17 14:15:01 +07:00

17 lines
663 B
Makefile

image = image_name
all: build
clean:
@docker images -f "dangling=true" -q | docker ps -a -f "ancestor={}" -q | xargs --no-run-if-empty docker rm
@docker images -f "dangling=true" -q | xargs --no-run-if-empty docker rmi -f
@docker ps --filter "ancestor=${image}" --format {{.ID}} | xargs --no-run-if-empty docker stop || true
@docker ps -a --filter "ancestor=${image}" --format {{.ID}} | xargs --no-run-if-empty docker rm || true
@docker images --filter "reference=${image}" --format {{.ID}} | xargs --no-run-if-empty docker rmi || true
build:
@docker build --tag=${image} --no-cache .
release: build
@docker build --tag=${image}:$(shell cat VERSION) .