Tuesday, August 9, 2016

Docker Cheatsheet

Docker Cheatsheet

Build Commands:

docker build -t myapp:1.0 .

This command will build your docker image from the Dockerfile in the current directory.

docker images

This command will list all images which are locally stored with Docker engine.

docker rmi myapp:1.0

This command will remove/Delete the stored image from Docker engine.


Ship Commands:

docker pull myapp:latest

This command will pull image from registry.

docker push myrepo/myapp:1.1

Run Commands:

docker run --rm remove container automatically after exit
                   -t connect the container to terminal 
                   -name test name the container
                   -p 5000:80 expose port no 5000 externally and map to port 80

docker stop test

Stop the running container with name test.

docker rm test

remove the stopped container with name test

docker exec -it test bash

Create a new bash process inside the container and connect it to the terminal.

docker logs --tail 100 test

Print last 100 line of container logs.



No comments:

Post a Comment

Terraform Cheat Sheet [WIP]

Installing Terraform