Glimpsing Guruvar 2 - Introduction To Containerization and Docker
Glimpsing Guruvar 2 - Introduction To Containerization and Docker
By
Pallavi
Agenda
A bit of History
Virtual Machines
Containerization
Docker
• Src- devrant.
https://www.google.com
/url?sa=i&url=https%3A
%2F%2Fdevrant.com
%2Fsearch%3Fterm
%3Ddocker&psig=AOvVa
w1kAlMe_MF_nTuEFhBF
V76l&ust=158581913991
3000&source=images&c
d=vfe&ved=0CAMQjB1q
FwoTCMCupefyxugCFQA
AAAAdAAAAABAJ
Factor 1- Application Architecture
Src-
https://www.slideshare.net/Docker/introduction-to-docke
r-2017/16
Monolithic vs Micro-services
Src- https://aws.amazon.com/microservices/
Microservice
• From a strategy perspective, microservices architecture
essentially follows the Unix philosophy of "Do one thing and do
it well".
Source--https://en.wikipedia.org/wiki/Microservices
Factor 2 – Application Lifecycle
Src-
https://www.slideshare.net/Docker/introduction-to-docker-2017
Devs vs Ops
Src- https://www.devops.ch/2017/05/10/devops-explained/
Virtual Machines
Containers
Src –
https://www.contino.io/insights/beyond-docker-other-types-of-c
VM vs Containers
src- https://docs.docker.com/get-started/
Is Docker the only Container?
• No, many other examples are –
• Java containers
• Unikernels
• LXD
• OpenVZ
• Etc
• Docker is the most popular 2 main events –
– Growing need from web scale companies like Google
– Simple tooling made popular by Docker open source project
Setup Docker on Windows
• https://docs.docker.com/docker-for-windows/install /
• System Requirements
• Windows 10 64-bit: Pro, Enterprise, or Education (Build
15063 or later).
• Hyper-V and Containers Windows features must be enabled.
• The following hardware prerequisites are required to
successfully run Client Hyper-V on Windows 10:
– 64 bit processor with Second Level Address Translation (SLAT)
– 4GB system RAM
– BIOS-level hardware virtualization support must be enabled in the
BIOS settings. For more information, see Virtualization.
Install Docker [Other Windows Edition]
• https://docs.docker.com/toolbox/toolbox_install_wi
ndows
/
• Click on –
• docker --version
• docker run hello-world [will fetch local copy]
• docker image history hello-world
• docker container create hello-world helloCont
• docker container ls -all
Docker Hub
• Create an account at Docker Hub
• Src- https://phoenixnap.com/kb/docker-image-vs-container
Process from File to Container
• We have a set of
instructions in form of a
script called as DockerFile
• To create “image” , we
use docker build ,
command.
• To create container from
image , we use docker
create, command.
Src-
https://medium.com/microservices-for-net-developers/building-your-
first-net-core-container-e3c583e0b637
Lets Build One
Src-
https://www.howtoforge.com/tutorial/how-to-create-docker-imag
es-with-dockerfile
/
https://examples.javacodegeeks.com/devops/docker/docker-hello-
world-example/
MySql
• docker pull mysql
• docker run --detach --name=pallavi-mysql
--env="MYSQL_ROOT_PASSWORD=unicorn"
--publish 6603:3306 mysql:latest [create container]
• docker exec -it pallavi-mysql bash
• docker-machine ip default [to find machine ip]
• docker inspect CONTAINER_ID
• Connect from outside.
• mysql -uroot -punicorn -h192.168.99.100 -P6604
Src- https://severalnines.com/database-blog/mysql-docker-containers-understanding-basics
Other helpful commands
• Docker ps –a [lists all containers]
• Docker stop [container name]
• Docker rm –f [image name]
• Docker image prune –a [remove all images]
• https://docs.docker.com/engine/reference/comman
dline/docker
/
• Commonly used commands -
https://dzone.com/articles/top-docker-commands-i
tsyndicate
Q&A