Top Banner
LINUX CONTAINERS AND DOCKER OPEN PLATFORM Rahul More
23
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Docker lxc win

LINUX CONTAINERS AND DOCKER OPEN PLATFORM

Rahul More

Page 2: Docker lxc win
Page 3: Docker lxc win

Docker is an open platform for developers and sysadmins to build, ship, and run

distributed applications

Page 4: Docker lxc win

?

• “an open source platform to pack, ship and run any application as a lightweight linux container.”

• “chroot on steroids.”

Page 5: Docker lxc win
Page 6: Docker lxc win

TRADITIONSVM vs Docker

Page 7: Docker lxc win

WHY TO USE DOCKER-MINGLE

• Developers

• QA

• Nebulous SYS Admins-ish

Page 8: Docker lxc win

DEVELOPERS

“works on my machine”

Page 9: Docker lxc win

QA

“does not work on my test environment”

Page 10: Docker lxc win

SYS ADMIN

“I want my weekend”

Page 11: Docker lxc win

WHY USE DOCKER?

• Portable deployments.

• Fast Application delivery.

• Scale and deployed with ease.

• Higher workloads - greater density.

Page 12: Docker lxc win

Dev App Container

Tester

Container

Sys AdminAutomation

ProductionEnvironments

Page 13: Docker lxc win

TRADITIONSVM vs Docker

Page 14: Docker lxc win

DOCKER ARCHITECTURE

Page 15: Docker lxc win

DOCKER • Client Server Architecture.

• Socket or REST APIs

• Docker Daemon

• All container operations

• Docker Client

• Main interface between user and docker daemon.

• Docker Internal Components.

Page 16: Docker lxc win

DOCKER COMPONENTS• Docker Internal Components

• Docker Image

• Similar to OS disk images.

• Used as base , layers build upon the base image[Layer 0].

• Portable.

• Docker Registry

• Repository of Docker Images.

• Public or Private.

• Docker Containers

• Running Images

• Directory + Execution Environment.

• Isolated.

• User Space + Networking + Security Components.

Docker Image

Kernal

Docker Engine

Docker Registr

y

Docker Container

Page 17: Docker lxc win

WORKING OF DOCKER• Docker Image.

• Each image is association of images.

• Layered approach for abstraction.

• Unified file system. Each layer as a directory.

• Dockerfile.Base Image

Layered Image-2[add apache]

Running Container [php application

Layered Image-2[add php]

Layered Image-3[add mysql]

Reference Image

Page 18: Docker lxc win

WORKING OF DOCKER

• Docker Registry.

• All images are stored in a client.

• Private or public.

• Images are pulled and pushed in a registry.

Page 19: Docker lxc win

WORKING OF DOCKER• Docker Container.

• Run time environment.

• Command from REST API/Docker Binary to run the container.

• sudo docker run -i -t ubuntu /bin/ bash

Docker client

Docker Daemon

Container

Pulled Image

REPOSITORY

Creates Containers from Image

Binary API Request

Page 20: Docker lxc win

DOCKER• sudo docker run -i -t ubuntu /bin/

bash

• Docker client will be launched with “docker run” command.

• It tells the daemon, from which image the container should be created. In our example, it is a Ubuntu image.

• “-i” tells the Docker daemon to run the container in interactive mode.

• “-t” represents tty mode for interactive session.

• “/ bin/ bash” tells the Docker daemon to start the bash shell when the container is launched.

Docker client

Docker Daemon

Container

Pulled Image

REPOSITORY

Creates Containers from Image

Binary API Request

Page 21: Docker lxc win

DOCKER• Successful Execution of run.

• Checks for the image.

• Pulls the image to create a container.

• Creates a read/write filesystem over the image.

• Creates a network interface for the container to interact with host machine.

• Checks for IP . Allocates IP.

• Executes the command specified.

• Logs.

Docker client

Docker Daemon

Container

Pulled Image

REPOSITORY

Creates Containers from Image

Binary API Request

Page 22: Docker lxc win

IMMUTABLE INFRASTRUCURE

• Immutable infrastructure comprises of immutable components and for every deployment the components will be replaced with the updated component rather than being updated.

Page 23: Docker lxc win

DEMO• A static web application

running on apache.

• A mysql Image.

• Wordpress application with MYSQL db.

• Hosting multiple websites on docker host.

• Building and testing containers using Jenkins CI.