0% found this document useful (0 votes)
399 views24 pages

Glimpsing Guruvar 2 - Introduction To Containerization and Docker

In this glimpsing guruvar, second series we will talk about the concept of containerization and get introduced to the world of docker.

Uploaded by

Pallavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
0% found this document useful (0 votes)
399 views24 pages

Glimpsing Guruvar 2 - Introduction To Containerization and Docker

In this glimpsing guruvar, second series we will talk about the concept of containerization and get introduced to the world of docker.

Uploaded by

Pallavi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
You are on page 1/ 24

Glimpsing Guruvar

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".

• Martin Fowler describes a microservices-based architecture as


having the following properties:
– A change to a small part of the application only requires rebuilding
and redeploying only one or a small number of services.
– Adheres to principles such as fine-grained interfaces (to independently
deployable services), business-driven development.

Source--https://en.wikipedia.org/wiki/Microservices
Factor 2 – Application Lifecycle

Src- ecs digital – from pin interest.


CI -CD

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

A container is a lightweight, virtualised, portable,


software-defined environment in which software
can run in isolation of other software running on
the physical host machine.

Developers love containers because they enable


fast paced iterative development/test cycles.

Ops love containers because they can focus on


runtime tasks such as logging, monitoring,
lifecycle management and resource utilization
rather than deployment and dependency
management

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

• Search for certified images- https://


hub.docker.com/search?certification_status=c
ertified&type=image
Images vs Containers
• A Docker image is an immutable (unchangeable) file that
contains the source code, libraries, dependencies, tools, and
other files needed for an application to run.

• A Docker container is a virtualized run-time environment where


users can isolate applications from the underlying system.

• Images can exist without containers, whereas a container needs


to run an image to exist.

• 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

• Create a Java Program – HelloGlobe


• Create a DockerFile – using a base docker image, adding our
class, running jdk , and providing an entry point.
• Using Dockerfile, we create our Docker Image
• docker-hello-globe:latest

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

You might also like