Skip to content

Instantly share code, notes, and snippets.

@lee-pai-long
Last active September 5, 2017 13:32
Show Gist options
  • Select an option

  • Save lee-pai-long/3e894afff47a4640630471aa007b5484 to your computer and use it in GitHub Desktop.

Select an option

Save lee-pai-long/3e894afff47a4640630471aa007b5484 to your computer and use it in GitHub Desktop.
Docker remove container or image

[DOCKER] Remove

Remove all stopped containers.

$ [sudo] docker rm $([sudo] docker ps -a -q)

Remove all untagged images.

$[sudo] docker rmi \
> $(sudo docker images | grep "^<none>" | awk '{print $3}')

Source: https://goo.gl/UtG64o

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment