Skip to content

Instantly share code, notes, and snippets.

@miPlodder
Last active September 6, 2021 06:03
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 miPlodder/82ab9950713b3a885a73df2a492703fa to your computer and use it in GitHub Desktop.
Save miPlodder/82ab9950713b3a885a73df2a492703fa to your computer and use it in GitHub Desktop.
This gist contains list of useful docker commands.

Windows Sub-system for Linux list

wsl -l -v

Version of installed docker

docker version

Run an image

docker run hello-world

Login to Dockerhub

docker login

Shows list of all the images

docker images

Remove an docker image

docker rmi <image-id> docker rmi -f <image-id> --forces removal of the image

Pull an image from Dockerhub

docker pull <image-name>

Push an image to Dockerhub

docker push <image-name>

Shows list of all the containers

docker ps -a

Stop a running container

docker stop <container-id>

Remove a container

docker rm <container-id>

Note:

  • Dockerfile is used to create docker image.
  • docker-compose.yml contains all of the services (web/postgres/redis). In order to run this yml file use below command, docker compose up
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment