Skip to content

Instantly share code, notes, and snippets.

@RichardDally
Last active November 2, 2019 13:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RichardDally/9a8ecfaee6942483e36679bba61f89bd to your computer and use it in GitHub Desktop.
Save RichardDally/9a8ecfaee6942483e36679bba61f89bd to your computer and use it in GitHub Desktop.
Docker cheat sheet
List all running containers
$ docker ps
List all containers
$ docker ps -a
Start mongo:3.4-xenial (tagged mongo-test-server) and expose port 27017
$ docker run --publish 27017:27017 --name mongo-test-server --detach mongo:3.4-xenial
Stop container <container_name>
$ docker stop <container_name>
Remove all stop containers
$ docker rm $(docker ps -a -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment