Skip to content

Instantly share code, notes, and snippets.

@cse031sust02
Last active August 21, 2019 09:09
Show Gist options
  • Save cse031sust02/c77c0c29589a38993450a53b0ade716d to your computer and use it in GitHub Desktop.
Save cse031sust02/c77c0c29589a38993450a53b0ade716d to your computer and use it in GitHub Desktop.
Docker commands
  • download images to our computer
$ docker pull <image-name>
  • builds an image from a Dockerfile
$ docker build <path>
  • docker images that have been downloaded/built
$ docker images
  • removes one or more images
$ docker rmi <image-name>
  • run a container
$ docker run <image-name>
  • list of containers
$ docker ps
  • enter the bash of a container
$ docker exec -it <container-id-or-name> bash
  • stop containers
$ docker stop <container-id-or-name>
  • removes one or more containers
$ docker rm <container-id-or-name>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment