Hello, Willy!
%3
Why?
● Work in local, does not work in production
● Use existed app
● Multiple isolated deamon instances
● Bundle you app
● Dependency hell
%5
Roadmap
● Glossary: Сontainer?
● Tools
● Use Cases
%8
Glossary
%10
Glossary
● Image
%13
Image
%15
Glossary
● Image
● Container
%18
Сontainer?
%21
Container is not VM
● Lite for machine: size, CPU, memory
● VM provides more isolation
● Plenty of tools
● Easy to manage
● A lot of existed images
%23
Glossary
● Image
● Container
● Volume
%26
Glossary
● Image
● Container
● Volume
● Registry
%28
Glossary
● Image
● Container
● Volume
● Registry
● Docker
%31
Glossary
● Image
● Container
● Volume
● Registry
● Docker
● Compose
%33
Glossary
● Image
● Container
● Volume
● Registry
● Docker
● Compose
● Machine
%36
Tools
● Docker CLI – docker
● Compose – docker-compose
● Machine – docker-machine
%38
Docker CLI
● Image
$ docker pull ubuntu:latest
%41
Docker CLI
● Image
$ docker pull ubuntu:latest
$ docker build -t
eoskin/serverauditor:dev .
%46
Docker CLI
● Image
$ docker pull ubuntu:latest
$ docker build -t
eoskin/serverauditor:dev .
$ docker tag eoskin/serverauditor:dev
eoskin/serverauditor:prod
%49
Docker CLI
● Image
$ docker pull ubuntu:latest
$ docker build -t
eoskin/serverauditor:dev .
$ docker tag eoskin/serverauditor:dev
eoskin/serverauditor:prod
$ docker push
eoskin/serverauditor:prod
%51
Docker CLI
● Image
$ docker pull ubuntu:latest
$ docker build -t
eoskin/serverauditor:dev .
$ docker tag eoskin/serverauditor:dev
eoskin/serverauditor:prod
$ docker push
eoskin/serverauditor:prod
$ docker rmi eoskin/serverauditor:prod
%54
Docker CLI
● Container
$ docker run [-ti] ubuntu:latest bash
$ docker run -d
eoskin/serverauditor:dev
%56
Docker CLI
● Container
$ docker run [-ti] ubuntu:latest bash
$ CID=$(docker run -d
eoskin/serverauditor:dev)
$ docker ps $CID
%59
Docker CLI
● Container
$ docker run [-ti] ubuntu:latest bash
$ CID=$(docker run -d
eoskin/serverauditor:dev)
$ docker ps $CID
$ docker logs $CID
%62
Docker CLI
● Container
$ docker run [-ti] ubuntu:latest bash
$ CID=$(docker run -d
eoskin/serverauditor:dev)
$ docker ps $CID
$ docker logs $CID
$ docker stop $CID
$ docker start $CID
%64
Docker CLI
● Container
$ docker start $CID
$ docker inspect $CID | jq
$ docker exec $CID bash
%67
Docker CLI
● Container
$ docker start $CID
$ docker inspect $CID | jq
$ docker exec $CID bash
$ docker kill $CID
$ docker rm $CID
%69
Compose
● docker-compose up -d web
%72
Compose
● docker-compose up -d web
● docker-compose build web
%74
Compose
● docker-compose up -d web
● docker-compose build web
● docker-compose logs web
● etc.
%77
Machine
● docker-machine create -d [DRIVER]
willy
● docker-machine ls
%79
Machine
● docker-machine create -d [DRIVER]
willy
● docker-machine ls
● eval $(docker-machine env willy)
● docker $(docker-machine config
willy) ps
%82
Machine
● docker-machine create -d [DRIVER]
willy
● docker-machine ls
● eval $(docker-machine env willy)
● docker $(docker-machine config willy)
ps
● docker-machine ssh whilly
● docker-machine kill whilly
%85
Use Cases
● Work in local, does not work in production
● Use existed app
● Multiple isolated deamon instances
● Bundle you app
● Dependency hell
%87
Use Cases
● Work in local, does not work in production
– Locally:
● Build image
● Push to the registry
– Anywhere:
● Pull the image from registry
● Run image
%90
Use Cases
● Use existed app
– Postgis
– MongoDB
– Redis
– Cacti
– Node
– Python
– Ruby
– Java
%92
Use Cases
● Multiple isolated deamon instances
– Serverauditor Termius ssh farm
%95
Use Cases
● Dependency hell
– Containers are isolated
– Use build depdencies only when build
– Share build environment with build-images
%97
References
● https://washraf.gitbooks.io/the-docker-ecosyste
m/content/index.html
● https://docs.docker.com/
%100

Docker presentation