From a9f1b7a26df82c0121661c78258d7ae11ce3dbd0 Mon Sep 17 00:00:00 2001 From: Chris Ashton Date: Thu, 28 Nov 2024 16:43:45 +0000 Subject: [PATCH] Document the "get back to clean slate" option We've [discussed adding this before](https://github.com/alphagov/govuk-docker/pull/434#pullrequestreview-533335033), and shied away from it in favour of more focussed troubleshooting. But sometimes folks just want a quick and easy task to reset things - so let's add this in. --- docs/how-tos.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/how-tos.md b/docs/how-tos.md index 1f4633b5..a3c414f6 100644 --- a/docs/how-tos.md +++ b/docs/how-tos.md @@ -2,6 +2,14 @@ 👉 [Check the troubleshooting guide if you have a problem.](troubleshooting.md#installation) +## How to: get back to a clean slate + +If you encounter an issue with your Docker setup and you've already exhausted all other ideas, here's a quick one-liner that stops and removes absolutely everything. You can then follow the govuk-docker README instructions for `make`-ing your app again. + +``` +docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q) && docker rmi $(docker images -q) -f && docker volume prune && docker container prune && docker image prune && docker network prune && docker system prune --all --volumes +``` + ## How to: reduce typing with shortcuts Typing the [full commands](../README.md#usage) is likely to get tiring. We've added a couple of lightweight helper scripts alongside govuk-docker, which figure out the application you're running based on the name of the current directory.