Last active
May 30, 2017 06:55
-
-
Save okram999/96be97ec810e5543aaddef8687e1f638 to your computer and use it in GitHub Desktop.
Some docker commands gathered
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
#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