Skip to content

Instantly share code, notes, and snippets.

@paveltimofeev
Last active April 5, 2017 12:21
Show Gist options
  • Save paveltimofeev/542bedc07a9a6c46c0f243867f3da081 to your computer and use it in GitHub Desktop.
Save paveltimofeev/542bedc07a9a6c46c0f243867f3da081 to your computer and use it in GitHub Desktop.
Docker hints, tips & tricks

Docker hints, tips & tricks

How to remove all exited containers:

docker rm $(docker ps -aq -f exited=137)    # exited by 137 code
docker rm $(docker ps -aq -f exited=0)      # exited by 0 code

How to remove all unused images:

# ALL images that is NOT RUNNING now will removed
docker rmi $(docker images -q)

How to get containers' ids:

docker ps -q    # only running containers
docker ps -aq   # all

###Gulp build

docker run -it --rm -v "$(pwd):/temp" -w="/temp" node bash -c 'npm i && npm i gulp -g && gulp && exit'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment