SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
Introducing Docker
Francesco Pantano
francesco.pantano@opmbx.it
March 17, 2016
#Outline
1 Virtualization
2 Containers
3 Docker in practice
4 Docker Compose
5 Continuous integration
Virtualization 2/24
Thinking about VMM
The Key component is the Hypervisor, a Virtual Machine Monitor
that can be thought as an API that provides access to the hw level
for the VMs.
Hosted ()
abstract guest operating
systems from the host one
Bare Metal()
run directly on the host’s
hardware
VMware Workstation/Player, VirtualBox and QEMU are examples
of hosted hypervisors
Virtualization 3/24
Deep into Light Virtualization
Born on top of LXC project, a set of tools built on a userspace
interface for the Linux kernel containment features, LV uses the
following kernel features to contain processes:
Kernel namespaces (ipc, uts, mount, pid, network and user)
Chroots (using pivot root)
CGroups (control groups)
Relies on your existing
system;
Services stay in the kernel
host;
Virtualization 4/24
Cgroups
Cgroups (abbreviated from control groups) is a Linux kernel feature
that limits, accounts for and isolates the resource usage (CPU,
memory, disk I/O, network, etc.) of a collection of processes.
Cgroups provides:
Resource Limiting: groups can be set to not exceed a
configured memory limit
Prioritization: some groups may get a larger share of CPU
utilization or disk I/O
Accounting: measures how much resources certain systems
use
Control: freezing the groups of processes, their checkpointing
and restarting
Virtualization 5/24
Namespaces
Isolation
Groups of processes are separated so they cannot ”see” resources
in other groups. For example, a PID namespace provides a
separate enumeration of process identifiers within each namespace.
struct upid {
int nr; // the PID value
// namespace where this PID is
relevant
struct pid_namespace *ns;
// ...
};
struct pid {
// number of upids
int level;
// array of upids
struct upid numbers [0];
};
Virtualization 6/24
The Layered Filesystem
Union file systems, or UnionFS, are file systems that operate by
creating layers, making them very lightweight and fast.
Copy-On-Write
It enables sharing that promotes smaller images
Virtualization 7/24
#Outline
1 Virtualization
2 Containers
3 Docker in practice
4 Docker Compose
5 Continuous integration
Containers 8/24
Why Containers?
Fast deployment time
It’s cheap and flexible
Scalability and support
Docker as standardized platform
Docker is a platform for developing, shipping,
and running applications using container
virtualization technology.
Containers 9/24
The Docker environment
Containers 10/24
Docker: Terminology
Image: layered filesystem where each layer references the layer
below
Dockerfile: build script that defines:
an existing image as starting point
a set of instructions that augment that
image (each of which results in another
layered filesystem)
metadata such as ports exposed
the command to executed when the
image is run
Container: runtime instance of an image
plus a read/write layer
Docker Hub: centralized repository of docker images
Containers 11/24
#Outline
1 Virtualization
2 Containers
3 Docker in practice
4 Docker Compose
5 Continuous integration
Docker in practice 12/24
Quick Start
Linux - run natively e.g. on Ubuntu
apt-get install docker.io
curl -sSL https://get.docker.com/ubuntu — sh
Mac / Windows run under VirtualBox
http://boot2docker.io
Docker Machine - https://github.com/docker/machine
docker machine -d virtual-box dev
docker machine -d openstack test
docker machine -d softlayer ... prod
Verify ..
$ docker version
Client/Server:
Version: 1.9.1
OS/Arch: linux/amd64
.. your installation
$ docker info
Client/Server:
Version: 1.9.1
OS/Arch: linux/amd64
Docker in practice 13/24
Quick Start
Linux - run natively e.g. on Ubuntu
apt-get install docker.io
curl -sSL https://get.docker.com/ubuntu — sh
Mac / Windows run under VirtualBox
http://boot2docker.io
Docker Machine - https://github.com/docker/machine
docker machine -d virtual-box dev
docker machine -d openstack test
docker machine -d softlayer ... prod
Verify ..
$ docker version
Client/Server:
Version: 1.9.1
OS/Arch: linux/amd64
.. your installation
$ docker info
Client/Server:
Version: 1.9.1
OS/Arch: linux/amd64
Docker in practice 13/24
Quick Start
Linux - run natively e.g. on Ubuntu
apt-get install docker.io
curl -sSL https://get.docker.com/ubuntu — sh
Mac / Windows run under VirtualBox
http://boot2docker.io
Docker Machine - https://github.com/docker/machine
docker machine -d virtual-box dev
docker machine -d openstack test
docker machine -d softlayer ... prod
Verify ..
$ docker version
Client/Server:
Version: 1.9.1
OS/Arch: linux/amd64
.. your installation
$ docker info
Client/Server:
Version: 1.9.1
OS/Arch: linux/amd64
Docker in practice 13/24
Quick Start
Linux - run natively e.g. on Ubuntu
apt-get install docker.io
curl -sSL https://get.docker.com/ubuntu — sh
Mac / Windows run under VirtualBox
http://boot2docker.io
Docker Machine - https://github.com/docker/machine
docker machine -d virtual-box dev
docker machine -d openstack test
docker machine -d softlayer ... prod
Verify ..
$ docker version
Client/Server:
Version: 1.9.1
OS/Arch: linux/amd64
.. your installation
$ docker info
Client/Server:
Version: 1.9.1
OS/Arch: linux/amd64
Docker in practice 13/24
The Docker command line
docker search
Search for images in the docker hub
docker pull
Get a selected image from the docker hub
docker images
List all downloaded images
docker run
start a container
docker ps
List running images
docker build
Build an image from a Dockerfile
docker start/stop/kill
Containers management
docker rm/rmi
Remove a container / image
Docker in practice 14/24
Run your first container
$ docker search ubuntu
NAME DESCRIPTION STARS OFFICIAL A
ubuntu Ubuntu is a Debian-based Linux operating s... 3132 [OK] [
ubuntu-upstart Upstart is an event-based replacement for... 61 [OK] [
$ docker pull ubuntu:latest
latest: Pulling from library/ubuntu
92ec6d044cb3: Downloading 34.57 MB/65.68 MB
Digest: sha256:457b0587384bdhuis83290....6db5ae3934307c757c54
Status: Downloaded newer image for ubuntu:latest
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu latest 6cc0fc2a5ee3 1 minutes ago 187.9 MB
chef-server latest f3cd15749fa8 21 months ago 1.043 GB
$ docker run -i -t ubuntu /bin/bash
root@e550480534b1:/# apt-get update && apt-get install -y nginx
Docker in practice 15/24
Run your first container
$ docker search ubuntu
NAME DESCRIPTION STARS OFFICIAL A
ubuntu Ubuntu is a Debian-based Linux operating s... 3132 [OK] [
ubuntu-upstart Upstart is an event-based replacement for... 61 [OK] [
$ docker pull ubuntu:latest
latest: Pulling from library/ubuntu
92ec6d044cb3: Downloading 34.57 MB/65.68 MB
Digest: sha256:457b0587384bdhuis83290....6db5ae3934307c757c54
Status: Downloaded newer image for ubuntu:latest
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu latest 6cc0fc2a5ee3 1 minutes ago 187.9 MB
chef-server latest f3cd15749fa8 21 months ago 1.043 GB
$ docker run -i -t ubuntu /bin/bash
root@e550480534b1:/# apt-get update && apt-get install -y nginx
Docker in practice 15/24
Run your first container
$ docker search ubuntu
NAME DESCRIPTION STARS OFFICIAL A
ubuntu Ubuntu is a Debian-based Linux operating s... 3132 [OK] [
ubuntu-upstart Upstart is an event-based replacement for... 61 [OK] [
$ docker pull ubuntu:latest
latest: Pulling from library/ubuntu
92ec6d044cb3: Downloading 34.57 MB/65.68 MB
Digest: sha256:457b0587384bdhuis83290....6db5ae3934307c757c54
Status: Downloaded newer image for ubuntu:latest
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu latest 6cc0fc2a5ee3 1 minutes ago 187.9 MB
chef-server latest f3cd15749fa8 21 months ago 1.043 GB
$ docker run -i -t ubuntu /bin/bash
root@e550480534b1:/# apt-get update && apt-get install -y nginx
Docker in practice 15/24
Run your first container
$ docker search ubuntu
NAME DESCRIPTION STARS OFFICIAL A
ubuntu Ubuntu is a Debian-based Linux operating s... 3132 [OK] [
ubuntu-upstart Upstart is an event-based replacement for... 61 [OK] [
$ docker pull ubuntu:latest
latest: Pulling from library/ubuntu
92ec6d044cb3: Downloading 34.57 MB/65.68 MB
Digest: sha256:457b0587384bdhuis83290....6db5ae3934307c757c54
Status: Downloaded newer image for ubuntu:latest
$ docker images
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
ubuntu latest 6cc0fc2a5ee3 1 minutes ago 187.9 MB
chef-server latest f3cd15749fa8 21 months ago 1.043 GB
$ docker run -i -t ubuntu /bin/bash
root@e550480534b1:/# apt-get update && apt-get install -y nginx
Docker in practice 15/24
The Dockerfile
Dockerfile instruct on how to build the image automatically
Dockerfile syntax:
FROM
RUN
ENV
EXPOSE
ADD
CMD
$ docker build -t fmount/nginx .
$ docker run -d -p 80 –name mystaticwebsite -v
$PWD/website:/var/www/html/website fmount/nginx nginx
Docker in practice 16/24
The Docker Hub
It provides a mechanism to share images in the docker-hub, a
repository of shareable collection of tagged images
$ docker commit/login
Exercise: Be Social :D
Register in the Docker Hub
Connect it to your Github and build
Docker in practice 17/24
#Outline
1 Virtualization
2 Containers
3 Docker in practice
4 Docker Compose
5 Continuous integration
Docker Compose 18/24
Get an app running in one command
#!/ bin/python
from flask import Flask
from redis import Redis
app = Flask(__name__)
redis = Redis(host="localhost" ,
port =6379)
@app.route("/")
def hello ():
redis.incr("hits")
return "I have been seen %s
times .n"
% redis.get("hits")
if __name__ == "__main__":
app.run(host="0.0.0.0", debug=
True)
requirements.txt
flask package
redis package
Docker Compose 19/24
Get an app running in one command
Steps to follow
Write your Dockerfiles
Build your containers
Prepare your application
Think about the infrastructure
Compose in a Microservices fashion
Build and start the containers
$ docker-compose up
Docker Compose 20/24
#Outline
1 Virtualization
2 Containers
3 Docker in practice
4 Docker Compose
5 Continuous integration
Continuous integration 21/24
Use case: Continuous Integration
Continuous integration 22/24
Thank you! Questions?
More examples at
https://github.com/fmount/containers
Continuous integration 23/24
References
The Docker Book
www.dockerbook.com
How2dock
https://github.com/how2dock/docbook
Docker in Action
https://www.manning.com/books/docker-in-action
Official doc
https://docs.docker.com/
SlideShare Docker Channel
http://www.slideshare.net/Docker/
Golang tour :D
https://tour.golang.org/
Continuous integration 24/24

Weitere ähnliche Inhalte

Was ist angesagt?

Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XJérôme Petazzoni
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in developmentAdam Culp
 
Docker and the Container Ecosystem
Docker and the Container EcosystemDocker and the Container Ecosystem
Docker and the Container Ecosystempsconnolly
 
Introduction to Docker and deployment and Azure
Introduction to Docker and deployment and AzureIntroduction to Docker and deployment and Azure
Introduction to Docker and deployment and AzureJérôme Petazzoni
 
How to Dockerize Web Application using Docker Compose
How to Dockerize Web Application using Docker ComposeHow to Dockerize Web Application using Docker Compose
How to Dockerize Web Application using Docker ComposeEvoke Technologies
 
Docker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCSDocker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCSFrank Munz
 
Using Docker in the Real World
Using Docker in the Real WorldUsing Docker in the Real World
Using Docker in the Real WorldTim Haak
 
Docker - The Linux Container
Docker - The Linux ContainerDocker - The Linux Container
Docker - The Linux ContainerBalaji Rajan
 
Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Devoxx France 2015 - The Docker Orchestration Ecosystem on AzureDevoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Devoxx France 2015 - The Docker Orchestration Ecosystem on AzurePatrick Chanezon
 
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGHDeploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGHErica Windisch
 
Vagrant and docker
Vagrant and dockerVagrant and docker
Vagrant and dockerDuckDuckGo
 
Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Nicolas Poggi
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and AgentRanjit Avasarala
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with DockerGeeta Vinnakota
 

Was ist angesagt? (19)

ABCs of docker
ABCs of dockerABCs of docker
ABCs of docker
 
Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12X
 
Docker
DockerDocker
Docker
 
Docker
DockerDocker
Docker
 
Puppet and Vagrant in development
Puppet and Vagrant in developmentPuppet and Vagrant in development
Puppet and Vagrant in development
 
Docker and the Container Ecosystem
Docker and the Container EcosystemDocker and the Container Ecosystem
Docker and the Container Ecosystem
 
Introduction to Docker and deployment and Azure
Introduction to Docker and deployment and AzureIntroduction to Docker and deployment and Azure
Introduction to Docker and deployment and Azure
 
How to Dockerize Web Application using Docker Compose
How to Dockerize Web Application using Docker ComposeHow to Dockerize Web Application using Docker Compose
How to Dockerize Web Application using Docker Compose
 
Docker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCSDocker from A to Z, including Swarm and OCCS
Docker from A to Z, including Swarm and OCCS
 
Exploring Docker Security
Exploring Docker SecurityExploring Docker Security
Exploring Docker Security
 
Introduction To Docker
Introduction To  DockerIntroduction To  Docker
Introduction To Docker
 
Using Docker in the Real World
Using Docker in the Real WorldUsing Docker in the Real World
Using Docker in the Real World
 
Docker - The Linux Container
Docker - The Linux ContainerDocker - The Linux Container
Docker - The Linux Container
 
Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Devoxx France 2015 - The Docker Orchestration Ecosystem on AzureDevoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
 
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGHDeploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
 
Vagrant and docker
Vagrant and dockerVagrant and docker
Vagrant and docker
 
Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]Vagrant + Docker provider [+Puppet]
Vagrant + Docker provider [+Puppet]
 
Installaling Puppet Master and Agent
Installaling Puppet Master and AgentInstallaling Puppet Master and Agent
Installaling Puppet Master and Agent
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 

Andere mochten auch

The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...Docker, Inc.
 
Docker London: Container Security
Docker London: Container SecurityDocker London: Container Security
Docker London: Container SecurityPhil Estes
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker, Inc.
 

Andere mochten auch (6)

Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Docker volume
Docker volumeDocker volume
Docker volume
 
Docker for developers
Docker for developersDocker for developers
Docker for developers
 
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
 
Docker London: Container Security
Docker London: Container SecurityDocker London: Container Security
Docker London: Container Security
 
Docker 101: Introduction to Docker
Docker 101: Introduction to DockerDocker 101: Introduction to Docker
Docker 101: Introduction to Docker
 

Ähnlich wie Introducing Docker

Présentation de Docker
Présentation de DockerPrésentation de Docker
Présentation de DockerProto204
 
Introduction to Docker
Introduction  to DockerIntroduction  to Docker
Introduction to DockerJian Wu
 
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...NLJUG
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortalsHenryk Konsek
 
Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Ricardo Amaro
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerGuido Schmutz
 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 augVincent De Smet
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...Codemotion
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014Carlo Bonamico
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 applicationRoman Rodomansky
 
Delivering Docker & K3s worloads to IoT Edge devices
Delivering Docker & K3s worloads to IoT Edge devicesDelivering Docker & K3s worloads to IoT Edge devices
Delivering Docker & K3s worloads to IoT Edge devicesAjeet Singh Raina
 
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandDocker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandPRIYADARSHINI ANAND
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsElasTest Project
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerJim Yeh
 

Ähnlich wie Introducing Docker (20)

Présentation de Docker
Présentation de DockerPrésentation de Docker
Présentation de Docker
 
Docker Intro
Docker IntroDocker Intro
Docker Intro
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
Introduction to Docker
Introduction  to DockerIntroduction  to Docker
Introduction to Docker
 
From zero to Docker
From zero to DockerFrom zero to Docker
From zero to Docker
 
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
 
Docker intro
Docker introDocker intro
Docker intro
 
Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant Automate drupal deployments with linux containers, docker and vagrant
Automate drupal deployments with linux containers, docker and vagrant
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker Container
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 aug
 
Lab docker
Lab dockerLab docker
Lab docker
 
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...Why everyone is excited about Docker (and you should too...) -  Carlo Bonamic...
Why everyone is excited about Docker (and you should too...) - Carlo Bonamic...
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
Dockerizing a Symfony2 application
Dockerizing a Symfony2 applicationDockerizing a Symfony2 application
Dockerizing a Symfony2 application
 
Delivering Docker & K3s worloads to IoT Edge devices
Delivering Docker & K3s worloads to IoT Edge devicesDelivering Docker & K3s worloads to IoT Edge devices
Delivering Docker & K3s worloads to IoT Edge devices
 
Docker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini AnandDocker and containers - Presentation Slides by Priyadarshini Anand
Docker and containers - Presentation Slides by Priyadarshini Anand
 
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and JenkinsExpoQA 2017 Using docker to build and test in your laptop and Jenkins
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 

Kürzlich hochgeladen

WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...chiefasafspells
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 

Kürzlich hochgeladen (20)

WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 

Introducing Docker

  • 2. #Outline 1 Virtualization 2 Containers 3 Docker in practice 4 Docker Compose 5 Continuous integration Virtualization 2/24
  • 3. Thinking about VMM The Key component is the Hypervisor, a Virtual Machine Monitor that can be thought as an API that provides access to the hw level for the VMs. Hosted () abstract guest operating systems from the host one Bare Metal() run directly on the host’s hardware VMware Workstation/Player, VirtualBox and QEMU are examples of hosted hypervisors Virtualization 3/24
  • 4. Deep into Light Virtualization Born on top of LXC project, a set of tools built on a userspace interface for the Linux kernel containment features, LV uses the following kernel features to contain processes: Kernel namespaces (ipc, uts, mount, pid, network and user) Chroots (using pivot root) CGroups (control groups) Relies on your existing system; Services stay in the kernel host; Virtualization 4/24
  • 5. Cgroups Cgroups (abbreviated from control groups) is a Linux kernel feature that limits, accounts for and isolates the resource usage (CPU, memory, disk I/O, network, etc.) of a collection of processes. Cgroups provides: Resource Limiting: groups can be set to not exceed a configured memory limit Prioritization: some groups may get a larger share of CPU utilization or disk I/O Accounting: measures how much resources certain systems use Control: freezing the groups of processes, their checkpointing and restarting Virtualization 5/24
  • 6. Namespaces Isolation Groups of processes are separated so they cannot ”see” resources in other groups. For example, a PID namespace provides a separate enumeration of process identifiers within each namespace. struct upid { int nr; // the PID value // namespace where this PID is relevant struct pid_namespace *ns; // ... }; struct pid { // number of upids int level; // array of upids struct upid numbers [0]; }; Virtualization 6/24
  • 7. The Layered Filesystem Union file systems, or UnionFS, are file systems that operate by creating layers, making them very lightweight and fast. Copy-On-Write It enables sharing that promotes smaller images Virtualization 7/24
  • 8. #Outline 1 Virtualization 2 Containers 3 Docker in practice 4 Docker Compose 5 Continuous integration Containers 8/24
  • 9. Why Containers? Fast deployment time It’s cheap and flexible Scalability and support Docker as standardized platform Docker is a platform for developing, shipping, and running applications using container virtualization technology. Containers 9/24
  • 11. Docker: Terminology Image: layered filesystem where each layer references the layer below Dockerfile: build script that defines: an existing image as starting point a set of instructions that augment that image (each of which results in another layered filesystem) metadata such as ports exposed the command to executed when the image is run Container: runtime instance of an image plus a read/write layer Docker Hub: centralized repository of docker images Containers 11/24
  • 12. #Outline 1 Virtualization 2 Containers 3 Docker in practice 4 Docker Compose 5 Continuous integration Docker in practice 12/24
  • 13. Quick Start Linux - run natively e.g. on Ubuntu apt-get install docker.io curl -sSL https://get.docker.com/ubuntu — sh Mac / Windows run under VirtualBox http://boot2docker.io Docker Machine - https://github.com/docker/machine docker machine -d virtual-box dev docker machine -d openstack test docker machine -d softlayer ... prod Verify .. $ docker version Client/Server: Version: 1.9.1 OS/Arch: linux/amd64 .. your installation $ docker info Client/Server: Version: 1.9.1 OS/Arch: linux/amd64 Docker in practice 13/24
  • 14. Quick Start Linux - run natively e.g. on Ubuntu apt-get install docker.io curl -sSL https://get.docker.com/ubuntu — sh Mac / Windows run under VirtualBox http://boot2docker.io Docker Machine - https://github.com/docker/machine docker machine -d virtual-box dev docker machine -d openstack test docker machine -d softlayer ... prod Verify .. $ docker version Client/Server: Version: 1.9.1 OS/Arch: linux/amd64 .. your installation $ docker info Client/Server: Version: 1.9.1 OS/Arch: linux/amd64 Docker in practice 13/24
  • 15. Quick Start Linux - run natively e.g. on Ubuntu apt-get install docker.io curl -sSL https://get.docker.com/ubuntu — sh Mac / Windows run under VirtualBox http://boot2docker.io Docker Machine - https://github.com/docker/machine docker machine -d virtual-box dev docker machine -d openstack test docker machine -d softlayer ... prod Verify .. $ docker version Client/Server: Version: 1.9.1 OS/Arch: linux/amd64 .. your installation $ docker info Client/Server: Version: 1.9.1 OS/Arch: linux/amd64 Docker in practice 13/24
  • 16. Quick Start Linux - run natively e.g. on Ubuntu apt-get install docker.io curl -sSL https://get.docker.com/ubuntu — sh Mac / Windows run under VirtualBox http://boot2docker.io Docker Machine - https://github.com/docker/machine docker machine -d virtual-box dev docker machine -d openstack test docker machine -d softlayer ... prod Verify .. $ docker version Client/Server: Version: 1.9.1 OS/Arch: linux/amd64 .. your installation $ docker info Client/Server: Version: 1.9.1 OS/Arch: linux/amd64 Docker in practice 13/24
  • 17. The Docker command line docker search Search for images in the docker hub docker pull Get a selected image from the docker hub docker images List all downloaded images docker run start a container docker ps List running images docker build Build an image from a Dockerfile docker start/stop/kill Containers management docker rm/rmi Remove a container / image Docker in practice 14/24
  • 18. Run your first container $ docker search ubuntu NAME DESCRIPTION STARS OFFICIAL A ubuntu Ubuntu is a Debian-based Linux operating s... 3132 [OK] [ ubuntu-upstart Upstart is an event-based replacement for... 61 [OK] [ $ docker pull ubuntu:latest latest: Pulling from library/ubuntu 92ec6d044cb3: Downloading 34.57 MB/65.68 MB Digest: sha256:457b0587384bdhuis83290....6db5ae3934307c757c54 Status: Downloaded newer image for ubuntu:latest $ docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE ubuntu latest 6cc0fc2a5ee3 1 minutes ago 187.9 MB chef-server latest f3cd15749fa8 21 months ago 1.043 GB $ docker run -i -t ubuntu /bin/bash root@e550480534b1:/# apt-get update && apt-get install -y nginx Docker in practice 15/24
  • 19. Run your first container $ docker search ubuntu NAME DESCRIPTION STARS OFFICIAL A ubuntu Ubuntu is a Debian-based Linux operating s... 3132 [OK] [ ubuntu-upstart Upstart is an event-based replacement for... 61 [OK] [ $ docker pull ubuntu:latest latest: Pulling from library/ubuntu 92ec6d044cb3: Downloading 34.57 MB/65.68 MB Digest: sha256:457b0587384bdhuis83290....6db5ae3934307c757c54 Status: Downloaded newer image for ubuntu:latest $ docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE ubuntu latest 6cc0fc2a5ee3 1 minutes ago 187.9 MB chef-server latest f3cd15749fa8 21 months ago 1.043 GB $ docker run -i -t ubuntu /bin/bash root@e550480534b1:/# apt-get update && apt-get install -y nginx Docker in practice 15/24
  • 20. Run your first container $ docker search ubuntu NAME DESCRIPTION STARS OFFICIAL A ubuntu Ubuntu is a Debian-based Linux operating s... 3132 [OK] [ ubuntu-upstart Upstart is an event-based replacement for... 61 [OK] [ $ docker pull ubuntu:latest latest: Pulling from library/ubuntu 92ec6d044cb3: Downloading 34.57 MB/65.68 MB Digest: sha256:457b0587384bdhuis83290....6db5ae3934307c757c54 Status: Downloaded newer image for ubuntu:latest $ docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE ubuntu latest 6cc0fc2a5ee3 1 minutes ago 187.9 MB chef-server latest f3cd15749fa8 21 months ago 1.043 GB $ docker run -i -t ubuntu /bin/bash root@e550480534b1:/# apt-get update && apt-get install -y nginx Docker in practice 15/24
  • 21. Run your first container $ docker search ubuntu NAME DESCRIPTION STARS OFFICIAL A ubuntu Ubuntu is a Debian-based Linux operating s... 3132 [OK] [ ubuntu-upstart Upstart is an event-based replacement for... 61 [OK] [ $ docker pull ubuntu:latest latest: Pulling from library/ubuntu 92ec6d044cb3: Downloading 34.57 MB/65.68 MB Digest: sha256:457b0587384bdhuis83290....6db5ae3934307c757c54 Status: Downloaded newer image for ubuntu:latest $ docker images REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE ubuntu latest 6cc0fc2a5ee3 1 minutes ago 187.9 MB chef-server latest f3cd15749fa8 21 months ago 1.043 GB $ docker run -i -t ubuntu /bin/bash root@e550480534b1:/# apt-get update && apt-get install -y nginx Docker in practice 15/24
  • 22. The Dockerfile Dockerfile instruct on how to build the image automatically Dockerfile syntax: FROM RUN ENV EXPOSE ADD CMD $ docker build -t fmount/nginx . $ docker run -d -p 80 –name mystaticwebsite -v $PWD/website:/var/www/html/website fmount/nginx nginx Docker in practice 16/24
  • 23. The Docker Hub It provides a mechanism to share images in the docker-hub, a repository of shareable collection of tagged images $ docker commit/login Exercise: Be Social :D Register in the Docker Hub Connect it to your Github and build Docker in practice 17/24
  • 24. #Outline 1 Virtualization 2 Containers 3 Docker in practice 4 Docker Compose 5 Continuous integration Docker Compose 18/24
  • 25. Get an app running in one command #!/ bin/python from flask import Flask from redis import Redis app = Flask(__name__) redis = Redis(host="localhost" , port =6379) @app.route("/") def hello (): redis.incr("hits") return "I have been seen %s times .n" % redis.get("hits") if __name__ == "__main__": app.run(host="0.0.0.0", debug= True) requirements.txt flask package redis package Docker Compose 19/24
  • 26. Get an app running in one command Steps to follow Write your Dockerfiles Build your containers Prepare your application Think about the infrastructure Compose in a Microservices fashion Build and start the containers $ docker-compose up Docker Compose 20/24
  • 27. #Outline 1 Virtualization 2 Containers 3 Docker in practice 4 Docker Compose 5 Continuous integration Continuous integration 21/24
  • 28. Use case: Continuous Integration Continuous integration 22/24
  • 29. Thank you! Questions? More examples at https://github.com/fmount/containers Continuous integration 23/24
  • 30. References The Docker Book www.dockerbook.com How2dock https://github.com/how2dock/docbook Docker in Action https://www.manning.com/books/docker-in-action Official doc https://docs.docker.com/ SlideShare Docker Channel http://www.slideshare.net/Docker/ Golang tour :D https://tour.golang.org/ Continuous integration 24/24