+ All Categories
Home > Technology > Academy PRO: Docker. Part 1

Academy PRO: Docker. Part 1

Date post: 22-Jan-2018
Category:
Upload: binary-studio
View: 43 times
Download: 2 times
Share this document with a friend
32
Docker Academy PRO
Transcript

DockerAcademy PRO

Course’sAgenda

Introduction to Docker

Containerization Basics

Orchestration Basics

Miscellaneous

Today’sAgenda

What is containers?

Challenges & Solutions

How it works?

What is Docker?

Docker is an open platform that helps companies build, ship and run their

applications everywhere.

Evolution of IT

Earlier

● Thick client

● Well defined

stack

● Monolith

infrastructure

Today

● Thin client

● Many different

services

● Running on

different set of

resources

Static websiteUserDB

API

Web Frontend Queue

Redis + Redis-sentinel

Node.js + Express + Mongoose

MongoDB

Webpack + React + Redux

nginx + bootstrap

Development VMQA server

Public cluster

Production server

Contributors laptop

Customer datacenter

Cargo transport pre 1960

Matrix from hell

Solution

Linux Container (LXC)

cgroups - Linux kernel feature that limits, accounts for,

and isolates the resource usage (CPU, memory, disk I/O,

network, etc.) of a collection of processes.

namespaces - feature of the Linux kernel that isolates

and virtualizes system resources of a collection of

processes (pid, mnt, net..)

Linux Containers - operating-system-level virtualization

method for running multiple isolated Linux systems

(containers) on a control host using a single Linux kernel.

LXC combines the kernel's cgroups and support for

isolated namespaces to provide an isolated environment

for applications.

High level approach: lightweight VM

● own process space

● own network interface

● can run stuff as root

● can have own sbin/init

Low level approach: chroot on steroids

● can also not have its own sbin/init

● container = isolated process(es)

● share kernel with host

● no device emulation

Separation of concerns

Inside:

● code

● libs

● package manager

● app

● data

Outside:

● logging

● remote access

● network configuration

● monitoring

Build once - run everywhere!

Linux containers is units of software development

● run everywhere○ regardless of kernel version

○ regardless of host distro

○ BUT container and host architecture must match

● run anything○ if you can run it on host - you can run in the container

○ e.g. if it can run on Linux kernel, it can run

VMs vs Containers

Virtualization

Advantages:

● Multiple OS on same machine

● Easy maintenance and recovery

● Lower total cost of ownership

Disadvantages:

● Multiple VMs Lead to Unstable performance

● Hypervisors are not as efficient as host OS

● Long boot process

Containerization

Advantages over virtualization:

● Containers on same OS kernel are lighter

and smaller

● Better resource utilization

● Short boot-up process

Resource/Memory Utilization

16Gb 3Gb

2Gb

1Gb

4Gb

4Gb2Gb

16Gb 3Gb

4Gb

2Gb

VM Containers

7 Gb of Memory blocked and

cannot be used for new VMs

Containerd - industry-standard container runtime

with an emphasis on simplicity, robustness and

portability. It is available as a daemon for Linux and

Windows, which can manage the complete container

lifecycle of its host system: image transfer and

storage, container execution and supervision, low-

level storage and network attachments, etc..

runC - CLI tool for spawning and running

containers according to the OCI (Open Container

Initiative) specification.

What is Docker? #2

Docker is containerization platform which packages your application and all its

dependencies together in the form of containers so as to ensure that your

application works in the same way in any environment be it Development or

Test or Production

Why Docker?

● Isolation

● Lightweight

● Simplicity

● Workflow

● Community

Community

Community

Docker Adoption

Docker Adoption

Docker Adoption

Official Docker Images

https://hub.docker.com/explore/?page=1

Hello World!

$ docker run hello-world

Any questions?

The endfor today :)


Recommended