diff --git a/docker/README.md b/docker/README.md index 88e0f2546..bf98f49e9 100644 --- a/docker/README.md +++ b/docker/README.md @@ -121,7 +121,7 @@ docker-compose down to terminate the containers. -### Clean / Rebuild / Fetch Latest DB Image +### Clean and Rebuild DB from latest image To delete the active DB container, its volume and get the latest image / DB dump, simply run the following command: @@ -140,6 +140,24 @@ docker-compose pull db docker-compose build --no-cache db ``` +### Clean all + +To delete all containers for this project, its associated images and purge any remaining dangling images, simply run the following command: + +On Linux / macOS: + +```sh +cd docker +cleanall +``` + +On Windows: +```sh +cd docker +docker-compose down -v --rmi all +docker image prune +``` + ### Accessing MariaDB Port The port is exposed but not mapped to `3306` to avoid potential conflicts with the host. To get the mapped port, run the command *(from the project `/docker` directory)*: diff --git a/docker/cleanall b/docker/cleanall new file mode 100755 index 000000000..dd6f67669 --- /dev/null +++ b/docker/cleanall @@ -0,0 +1,7 @@ +#!/bin/bash + +echo "Shutting down any instance still running and purge images..." +docker-compose down -v --rmi all +echo "Purging dangling images..." +docker image prune +echo "Done!"