Last active
November 26, 2019 07:54
-
-
Save pajaydev/58401c04c76ae5a249252c6446b045d6 to your computer and use it in GitHub Desktop.
Handy Docker Commands
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################### | |
###################### 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