Skip to content

Instantly share code, notes, and snippets.

View velrino's full-sized avatar
:octocat:
Fortis Fortuna Adiuvat

Velrino velrino

:octocat:
Fortis Fortuna Adiuvat
View GitHub Profile
@velrino
velrino / remove-docker-containers.md
Created October 5, 2017 14:31 — forked from ngpestelos/remove-docker-containers.md
How to remove unused Docker containers and images
  1. Delete all containers

     $ docker ps -q -a | xargs docker rm
    

-q prints only the container IDs -a prints all containers

Notice that it uses xargs to issue a remove container command for each container ID

  1. Delete all untagged images