Docker

13
Docker Running an application into Linux containers.

Transcript of Docker

Page 1: Docker

Docker Running an application into Linux containers.

Page 2: Docker

What is Docker

❖ It is an open source project based on Linux containers developed by a company call dotcloud as their internal project

❖ It is a container engine that uses the Linux kernel features like Namespaces and Control Groups to create containers on top of an operating system

❖ It packages an application and its dependencies into a virtual container that can run on any linux server.

❖ Docker containers are very lightweight and portable.

Page 3: Docker

Containers ?❖Container are operating system virtualization methods

❖Linux kernel allows to run small isolated Linux boxes inside a single Linux host. These small isolated boxes are called Linux Containers.

❖The containers have isolated view of the operating environment in terms of process tree, File System and networks and Block IO.

❖Containers use the same kernel and they can be constrained to use only defined amount of resources like (CPU, Memory, IO).

Page 4: Docker

Docker Components | Docker Architecture

Page 5: Docker

Docker Architecture.

Page 6: Docker
Page 7: Docker

How Does Docker work ?1. you can create Docker images which holds your application

2. you can create Docker containers using images to run your application

3. you can share those Docker images using Docker Hub

Page 8: Docker

What are Docker Images❖ Read-only templates to launch the Docker containers.

❖ Generated by Docker Engine

❖ Usually consist of Base Operating System + Environment + Application➢ Ubuntu + Apache + My Application

❖ Docker engine generates these templates based on simple instructions where every instruction creates a layer on top of an existing image. These instructions are like:➢ Install a package

➢ Add a file

➢ Add an environment variable

➢ What processes to run while launching a container from this image

Page 9: Docker

What is a Docker container ?❖Instantiated form of the Docker Image is called Docker container.

❖It consist of Operating System + User Added Files + configuration + Metadata

Page 10: Docker

Underlying technologies used by Docker.Docker uses following features of the linux kernel to deliver the functionality we discussed:

Namespaces : Allows to manage the multiple workspaces() within single installation of Linux

Control Groups: It allows to define and limit the available resources of the Host Operating System (Memory, IO, CPU, Network)

Union File System : Union file systems, or UnionFS, are file systems that operate by creating layers, making them very lightweight and fast

Page 11: Docker

Linux namespaces used by DockerPID - It allows to manage different set of isolated processes for every container.

Net - network namespace allows to have multiple set of network interfaces and routing tables within single installation of Linux

IPC - It provides a mechanism to access the shared data between processes.

MNT - It is used to manage the file system mount points. Using the MNT namespace every container can have its own file system mount points.

UTS - It allows the containers to have their own hostname | Domain name

Page 12: Docker

Business usecases of the Docker● Code pipelines | Deployment workflow

● Multi -tenant system

● Application Isolation + Server Consolidation

● Application portability independent of Linux distributions

● Productivity

● Rapid Deployments

Page 13: Docker

LAB●Installing Docker on mac

○ https://docs.docker.com/mac/step_one/

○ https://www.docker.com/products/docker-toolbox

●Pulling a base image from Docker Hub●Running Docker container using the downloaded image●Adding changes to the container configurations●Creating an updated image from the modified container●Managing volumes and ports with containers●Interacting the running containers●Sharing your Docker images with Docker Hub●Using the shared docker images on AWS cloud