Skip to content

Instantly share code, notes, and snippets.

@vemuruadi
Created June 3, 2019 08:13
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 vemuruadi/24ae893726c4fbab0030b80b8c5ffd48 to your computer and use it in GitHub Desktop.
Save vemuruadi/24ae893726c4fbab0030b80b8c5ffd48 to your computer and use it in GitHub Desktop.
## Build image ##
docker build -t image_name .
### Build image with version tag ###
docker build -t image_name:version_tag . (To build particular version)
### Run image ###
docker run image_name -it bash
### Pull image from repository ###
docker pull image_name
### Pull Iimage with particular version ###
docker pull image_name:version_tag
### List all containers ###
docker ps
### Display logs of containers ###
docker logs --follw container_name
### Stop container ###
docker stop container_name
### Stop all running containers ###
docker stop $(docker ps -a -q)
### Remove container ###
docker rm container_name
### Remove all stopped containers ###
docker rm $(docker ps -a -q)
### Remove Image ###
docker rmi image_name
### Remove All images ###
docker rmi $(docker images -q)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment