Skip to content

Instantly share code, notes, and snippets.

@kostapc
Created August 8, 2023 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kostapc/a5272201aba06024e72fcbd9917c6426 to your computer and use it in GitHub Desktop.
Save kostapc/a5272201aba06024e72fcbd9917c6426 to your computer and use it in GitHub Desktop.
Cleanup docker env for free space
# also avoid "Docker environment should have more than 2GB free disk space" error
Write-Host "stopping all dockers" -ForegroundColor DarkRed
docker stop $(docker ps -a -q)
Write-Host "removing all docker" -ForegroundColor DarkRed
docker rm $(docker ps -a -q)
Write-Host "===================" -ForegroundColor DarkRed
Write-Host "performing docker system prune" -ForegroundColor DarkRed
docker system prune --volumes -f
docker ps -a
Write-Host "docker-clean done" -ForegroundColor DarkRed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment