add image removal to container-clean

This commit is contained in:
Emil Lerch 2020-11-24 15:19:26 -08:00
parent 6ce35caa5f
commit 0ab86f3063
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -242,7 +242,15 @@ clean: # @HELP removes built binaries and temporary files
clean: container-clean bin-clean
container-clean:
rm -rf .container-* .dockerfile-*
@rm -rf .container-* .dockerfile-*; \
for bin in $(BINS); do \
docker image exists "$(REGISTRY)/$$bin:$(VERSION)" && \
docker image rm "$(REGISTRY)/$$bin:$(VERSION)"; \
for platform in $(ALL_PLATFORMS); do \
docker image exists "$(REGISTRY)/$$bin:$(VERSION)__$$(echo $$platform | sed 's#/#_#g')" && \
docker image rm "$(REGISTRY)/$$bin:$(VERSION)__$$(echo $$platform | sed 's#/#_#g')"; \
done \
done; true
bin-clean:
rm -rf .go bin