Skip to content

Instantly share code, notes, and snippets.

@pajaydev
Last active November 26, 2019 07:54
Show Gist options
  • Save pajaydev/58401c04c76ae5a249252c6446b045d6 to your computer and use it in GitHub Desktop.
Save pajaydev/58401c04c76ae5a249252c6446b045d6 to your computer and use it in GitHub Desktop.
Handy Docker Commands
###################################################################
###################### DOCKER #################################
###################################################################
# check docker is installed in your system by typing docker
$ docker
###################### IMAGES #################################
# To check all exisiting docker images
$ docker images
# To pull the docker image from docker hub
$ docker pull node<image name> # i.e node is sample image for nodejs
# To remove the docker image
$ docker rmi <imageid> #i.e grasp image id by typing docker images
###################### CONTAINERS #################################
# list running containers
$ docker ps
# start the container
$ docker start [container-id]
# stop the container matching an id obtained from running `docker ps`
$ docker stop [container-id]
# remove the container
docker rm [container-id]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment