Skip to content

Instantly share code, notes, and snippets.

@okram999
Last active May 30, 2017 06:55
Show Gist options
  • Save okram999/96be97ec810e5543aaddef8687e1f638 to your computer and use it in GitHub Desktop.
Save okram999/96be97ec810e5543aaddef8687e1f638 to your computer and use it in GitHub Desktop.
Some docker commands gathered
#available images
docker images
#active containers
docker ps
#all the containers
docker ps -a
#running docker image
#docker run repository:tag <command>
docker run busybox:1.24 echo "hello world"
#run interactively in a tty + map port from host to the container
#host:container port
docker run -it -p 8888:8091 tomcat:8.0
#run as a daemon
docker run -d <>
#commit a docker image
docker commit 3fe776351466 okram999/debian:1.0
#build a docker images from a Dockerfile
#docker build -t <tag> <build context path>
docker build -t okram999/debian2 .
####Docker Compose Section#####
docker-compose up
docker-compose up -d
docker-compose logs
docker-compose logs -f
docker-compose stop
docker-compose rm
docker-compose build <<-- this will rebuild the images post a change in the Dockerfile. Else it will continue using the old image(s)
###Docker Network####
1. Closed / None Network
2. Bridge Network
3. Host Network
4. Overlay Network
#command to list the networks
docker network ls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment