Skip to content

Instantly share code, notes, and snippets.

@miguelangelgonzalez
Last active November 29, 2017 12:56
Show Gist options
  • Save miguelangelgonzalez/d077db302f889fc760552244cc6d29a4 to your computer and use it in GitHub Desktop.
Save miguelangelgonzalez/d077db302f889fc760552244cc6d29a4 to your computer and use it in GitHub Desktop.
Favorites dockers command

Delete all containers

docker rm -f $(docker ps -a -q)

Delete all images

docker rmi -f $(docker images -q)

Delete images "bc"

docker rmi -f $(docker images | grep bc | awk '{print $3}')

Delete all untagged images

docker rmi -f $(docker images | grep "<none>" | awk '{print $3}')

Show all IPs from ps

for id in $(docker ps -a -q); do 
    docker inspect --format "{{.NetworkSettings.Networks.nat.IPAddress}}/{{.Config.Image}}" $id 
done 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment