Last active
February 24, 2023 14:54
-
-
Save HDias/1d3e5ab3f34a8c5ea9cfd448f57f7ed7 to your computer and use it in GitHub Desktop.
Docker remove images ans containers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# remove containers exited | |
docker rm $(docker ps -a -f status=exited -q) | |
# remove unused images | |
docker rmi $(docker images -f dangling=true -q) | |
# get IP from container | |
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment