Skip to content

Instantly share code, notes, and snippets.

@koo5
Forked from schleumer/CLEAN-THE-FUCKING-DOCKER.fish
Last active January 6, 2022 23:26
Show Gist options
  • Save koo5/46f56656f4f3b09badea83d239318722 to your computer and use it in GitHub Desktop.
Save koo5/46f56656f4f3b09badea83d239318722 to your computer and use it in GitHub Desktop.
#!/usr/bin/env fish
# - https://gist.github.com/schleumer/3d7acf1bad48ef7a98945aafde90344d
function remove-docker-containers
echo "Stop running shit"
docker stop (docker ps -q)
echo "Remove the whale shit"
docker rm (docker ps -a -q)
end
function remove-docker-images
remove-docker-containers
echo "Remove pictures of whale shit"
docker rmi (docker images -f "dangling=true" -q)
end
function CLEAN-THE-FUCKING-DOCKER
remove-docker-images
echo "Fucking shit, those silly fucking whales eating my fucking disk"
docker volume rm (docker volume ls -qf dangling=true)
echo "That wasn't even all the shit!"
docker builder prune -af
echo "done m8"
end
CLEAN-THE-FUCKING-DOCKER
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment