Skip to content

Instantly share code, notes, and snippets.

@obedparla
Last active May 5, 2023 12:47
Show Gist options
  • Save obedparla/e3f91eb60cf692d893480d658b2add63 to your computer and use it in GitHub Desktop.
Save obedparla/e3f91eb60cf692d893480d658b2add63 to your computer and use it in GitHub Desktop.
Completely clean Docker resources (images, network, volumes)
Note: These commands will remove all your Docker resources, not just the images. Be sure to backup any important data from your Docker volumes before running these commands.
bash
```
# Stop all running Docker containers:
docker stop $(docker ps -aq)
# Remove all Docker containers:
docker rm $(docker ps -aq)
# Remove all Docker images:
docker rmi -f $(docker images -aq)
# Remove all Docker networks:
docker network prune -f
# Remove all Docker volumes:
docker volume prune -f
```
Now, you can reinstall your Docker images. Using docker compose: `docker-compose up -d`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment