DAC ASDM Container
DAC ASDM Container
2
Introduction to Containerization
Evolution of Computing
4
Containerization
❏ Light weight OS level sandboxing of applications
Runs multiple isolated apps on single host without hypervisor
6
Need for Containerization
Virtualization - Pros & Cons
❏ Abstraction to Hardware
❏ Isolation
❏ Encapsulation
❏ Portability
❏ Software Updates
❏ Continuous Integration & Continuous Delivery
7
Comparison
8
Containers
9
Why Containers?
10
Containers
11
Docker
❏ Docker is an open platform for developing, shipping, and
running applications. Docker Engine follows client-server
architecture.
12
13
Docker Internals
14
Docker Components
Docker Daemon
❏ The Docker daemon (dockerd) listens for Docker API
requests and manages Docker objects such as images,
containers, networks, and volumes.
❏ A daemon can also communicate with other daemons to
manage Docker services.
15
Docker Components
Docker Client
16
Docker Components
Docker Registries
❏ A Docker registry stores Docker images.
❏ Docker Hub and Docker Cloud are public registries
❏ Default – Docker Hub
❏ Private Registry
17
Docker Components
Docker Objects
Images
❏ An image is a read-only template with instructions for
creating a Docker container.
❏ An image is based on another image.
❏ To build your own image, create a Dockerfile with a simple
syntax for defining the steps needed to create the image and
run it.
❏ Each instruction in a Dockerfile creates a layer in the image
18
Docker Components
Docker Objects
Containers
❏ A container is a runnable instance of an image.
❏ You can create, start, stop, move, or delete a container using
the Docker API or CLI.
❏ By default, a container is relatively well isolated from other
containers and its host machine.
19
Docker Components
Docker Objects
Network
20
Docker Components
Docker Objects
Volumes
21
Dockerfile, Images & Containers
22
Dockerfile, Images & Containers
❏ Docker containers are building blocks for applications.
❏ Each container is an image with a readable/writeable layer on
top of a bunch of read-only layers.
❏ These layers are also called intermediate images.
❏ Layers are generated when the commands in the Dockerfile
are executed during the Docker image build.
23
Layers
24
Shared Layering
25
Container Deployments
26
Scaling
Reactive & Predictive/ Proactive Scaling
27
Horizontal Scaling (Reactive)
28
Vertical Scaling (Reactive)
29
Proactive Scaling
❏ Changing availability of resources are difficult to predict, is
complex.
❏ A promising approach to handle such dynamics is
self-adaptation that can be realized by a MAPE-K feedback
loop
❏ Monitor-Analyze-Plan-Execute plus Knowledge
30
Proactive Scaling
31
Prediction Techniques
❏ Prediction using ML Techniques
❏ Linear Regression
❏ Support Vector Machine
❏ Artificial Neural Network
❏ Reinforcement Learning (RL)
❏ Autoregressive integrated moving average (ARIMA)
❏ Hidden Markov Model (HMM)
❏ Exponential Smoothening 32
Scaling Options
❏ RR
Scaling-out:Reactive + Scaling-in: Reactive
❏ PR
Scaling-out: Predictive + Scaling-in: Reactive
❏ RP
Scaling-out: Reactive + Scaling-in: Predictive
❏ PP
Scaling-out: Predictive + Scaling-in: Predictive 33
Docker Orchestration
Kubernetes is an open source system for
managing containerized applications
across multiple hosts, providing basic
mechanisms for deployment,
maintenance, and scaling of applications.
36
Installation
❏ Uninstall old versions
❏ Install DOCKER CE
❏ docker-ce
❏ Verify the Installation
❏ docker run hello-world
37
Docker Commands
❏ docker info
❏ docker images
❏ docker search <image>
❏ docker pull
❏ docker run
❏ docker ps
❏ docker exec
38
Image Creation from a container
❏ docker container run -ti ubuntu bash
❏ apt-get update
❏ apt-get install -y figlet
❏ figlet "hello docker"
❏ docker container ls -a (In other terminal)
❏ docker container commit CONTAINER_ID
❏ docker image tag <IMAGE_ID> ourfiglet
❏ docker image ls -a
❏ docker container run ourfiglet figlet hello
39
Image Creation using a Dockerfile
❏ Example1 var os = require("os");
❏ Create a .js file var hostname = os.hostname();
console.log("hello from " + hostname);
FROM alpine
❏ Create Dockerfile RUN apk update && apk add nodejs
COPY . /app
WORKDIR /app
CMD ["node","index.js"]
45
Docker Compose
Using Compose is basically a three-step process:
❏ Define your app’s environment with a Dockerfile so it can be
reproduced anywhere.
❏ Define the services that make up your app in
docker-compose.yml so they can be run together in an
isolated environment.
❏ Run docker-compose up and Compose starts and runs your
entire app.
46
Docker Compose
A docker-compose.yml looks like this:
47
Containers Vs Services
48
Handson
Multi Service App using docker
Deploy the database
docker run -d -e POSTGRES_USER=odoo -e
POSTGRES_PASSWORD=odoo -e POSTGRES_DB=postgres
--name db postgres:10
Deploy ODOO
docker run -p 8069:8069 --name odoo --link db:db -t odoo
50
Multi Service App using docker-compose
docker-compose.yml
Ex: Wordpress
docker-compose up -d
51
Assignment
Docker Containers
❏ Creation of containers for multi service application using
docker.
❏ Creation of containers for multi service application using
docker-compose
53