Using Docker CLI
Luis Hernandez
Developer
lhernandez@nearsoft.com

Docker
Is a tool designed to make it easier to create, deploy, and run applications by using containers.
Portability

Build
Check images available locally:
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
imageName tagName someId randomDate someMBsBuild an image from a dockerfile:
$ docker build -t myapp:1.0 .Delete an image from the local image store:
$ docker rmi alpine:3.4Ship
Docker Hub
Cloud-based registry service which allows you to link to code repositories, build your images and test them, stores manually pushed images

Ship
Login with your docker hub account:
$ docker loginRetag a local image with a new image name and tag
$ docker tag alpine:3.4 myrepo/myalpine:3.4Push an image to the registry:
$ docker push myrepo/myalpine:3.4Grab an image from remote registry:
$ docker pull alpine:3.4Run
Run a container:
$ docker run
--rm
-it
--name containerName
-p 5000:80
-v ~/dev:/code
alpine:3.4
/bin/sh
$ docker stop containerName
$ docker kill containerNameStop running a container:
Managing Containers
Run a container:
$ docker ps
$ docker ps -a$ docker rm containerId
$ docker rm -f $(docker ps -aq)Delete containers:
Diving inside Containers
Excute process inside the container and connect it to the terminal:
$ docker exec -it containerName commandName$ docker logs containerNamePrint logs:
Docker-Compose
Compose is a tool for defining and running multi-container Docker applications.

Docker-Compose CLI
$ docker-compose start
$ docker-compose stop
$ docker-compose pause
$ docker-compose unpause
$ docker-compose ps
$ docker-compose up
$ docker-compose downThanks

Using Docker CLI
By Luis Hernandez
Using Docker CLI
- 727