Skip to content

Instantly share code, notes, and snippets.

@HDias
Last active February 24, 2023 14:54
Show Gist options
  • Save HDias/1d3e5ab3f34a8c5ea9cfd448f57f7ed7 to your computer and use it in GitHub Desktop.
Save HDias/1d3e5ab3f34a8c5ea9cfd448f57f7ed7 to your computer and use it in GitHub Desktop.
Docker remove images ans containers
# 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