Skip to content

Instantly share code, notes, and snippets.

@aavrug
Last active June 29, 2016 03:19
Show Gist options
  • Save aavrug/956df2417c4c72cb22271826f3d5ad2b to your computer and use it in GitHub Desktop.
Save aavrug/956df2417c4c72cb22271826f3d5ad2b to your computer and use it in GitHub Desktop.
Docker commands
// For pulling a docker image
docker pull <image-name>
// For building docker image
docker build .
// For removing a docker image
docker rmi <imageid>
// For forcefully removing a docker image
docker rmi -f <imageid>
// For building docker image with tag
docker build -t <name>:<tag> .
// For building image from custom file
docker build --file=php-nginx .
// For running docker image
docker run -p <port-id>:<expose-id> <imageid>
// For running docker image as a daemon
docker run -d -p <port-id>:<expose-id> <imageid>
// For docker containers list
docker ps -a
// For removing a docker container
docker rm <containerid>
// For forcefully removing a docker container
docker rm -f <containerid>
// For entering into docker container(Doing ssh on the container)
docker exec -it <containerid> bash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment