1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-07 07:56:12 +00:00

Add convenience functions to remove build images and containers (#11)

* Add convenience functions to remove build images and containers
* skip images with <none> tag
This commit is contained in:
h44z 2020-01-30 12:25:39 +01:00 committed by GitHub
parent 8370961d39
commit 4e04625918
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -356,6 +356,14 @@ clean:
docker ps --filter name=kopano_test* -aq | xargs docker rm -f || true
docker-compose -f $(DOCKERCOMPOSE_FILE) down -v --remove-orphans || true
.PHONY: clean-all-images
clean-all-images:
docker rmi $$(docker images --format '{{.Repository}}:{{.Tag}}' | grep '${docker_repo}/kopano_') | grep -v '<none>'
.PHONY: clean-all-containers
clean-all-containers:
docker ps -a | awk '{ print $$1,$$2 }' | grep '$(docker_repo)/kopano_' | awk '{print $$1 }' | xargs -I {} docker rm {}
.PHONY: test
test: ## Build and start new containers for testing (also deletes existing data volumes).
docker-compose -f $(DOCKERCOMPOSE_FILE) down -v --remove-orphans || true