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

More Related Content

PDF
A Hands-on Introduction to Docker
PDF
Docker by Example - Basics
PDF
Docker by Example - Quiz
PPTX
Docker Introductory workshop
PDF
Docker puebla bday #4 celebration
PDF
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
PPTX
Docker workshop
PDF
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose
A Hands-on Introduction to Docker
Docker by Example - Basics
Docker by Example - Quiz
Docker Introductory workshop
Docker puebla bday #4 celebration
Django로 만든 웹 애플리케이션 도커라이징하기 + 도커 컴포즈로 개발 환경 구축하기
Docker workshop
파이썬 개발환경 구성하기의 끝판왕 - Docker Compose

What's hot (19)

PPTX
ABCs of docker
PDF
Docker and Containers for Development and Deployment — SCALE12X
PDF
Docker
PDF
Docker
PDF
Puppet and Vagrant in development
PPTX
Docker and the Container Ecosystem
PDF
Introduction to Docker and deployment and Azure
PDF
How to Dockerize Web Application using Docker Compose
PDF
Docker from A to Z, including Swarm and OCCS
PPTX
Exploring Docker Security
PPTX
Introduction To Docker
PDF
Using Docker in the Real World
ODP
Docker - The Linux Container
PPTX
Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
PDF
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
PDF
Vagrant and docker
PDF
Vagrant + Docker provider [+Puppet]
PPTX
Installaling Puppet Master and Agent
PPTX
Getting Started with Docker
ABCs of docker
Docker and Containers for Development and Deployment — SCALE12X
Docker
Docker
Puppet and Vagrant in development
Docker and the Container Ecosystem
Introduction to Docker and deployment and Azure
How to Dockerize Web Application using Docker Compose
Docker from A to Z, including Swarm and OCCS
Exploring Docker Security
Introduction To Docker
Using Docker in the Real World
Docker - The Linux Container
Devoxx France 2015 - The Docker Orchestration Ecosystem on Azure
Deploying Docker (Provisioning /w Docker + Chef/Puppet) - DevopsDaysPGH
Vagrant and docker
Vagrant + Docker provider [+Puppet]
Installaling Puppet Master and Agent
Getting Started with Docker
Ad

Viewers also liked (6)

PDF
Docker for Developers
PDF
Docker volume
PDF
Docker for developers
PPTX
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
PDF
Docker London: Container Security
PDF
Docker 101: Introduction to Docker
Docker for Developers
Docker volume
Docker for developers
The Tale of a Docker-based Continuous Delivery Pipeline by Rafe Colton (ModCl...
Docker London: Container Security
Docker 101: Introduction to Docker
Ad

Similar to Introducing Docker (20)

PDF
Docker module 1
PDF
Docker intro
PPTX
Docker presentation
PPTX
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
PDF
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
PPTX
Java developer intro to environment management with vagrant puppet and docker
PDF
Introduction to Docker and Linux Containers @ Cloud Computing Rhein Main
PDF
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
PDF
Containers + Docker workshop - part 2
PPTX
Containerization using docker and its applications
PPTX
Containerization using docker and its applications
PDF
Victor Vieux at Docker Paris Meetup #1
PDF
Docker presentation | Paris Docker Meetup
PDF
Docker Introduction
PPTX
PDF
Docker Intro
PDF
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
PPTX
Virtualization, Containers, Docker and scalable container management services
PDF
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
PPTX
Docker and kubernetes
Docker module 1
Docker intro
Docker presentation
Java Developer Intro to Environment Management with Vagrant, Puppet, and Dock...
Docker for Developers: Dev, Test, Deploy @ BucksCo Devops at MeetMe HQ
Java developer intro to environment management with vagrant puppet and docker
Introduction to Docker and Linux Containers @ Cloud Computing Rhein Main
Introduction to Docker, December 2014 "Tour de France" Bordeaux Special Edition
Containers + Docker workshop - part 2
Containerization using docker and its applications
Containerization using docker and its applications
Victor Vieux at Docker Paris Meetup #1
Docker presentation | Paris Docker Meetup
Docker Introduction
Docker Intro
ExpoQA 2017 Using docker to build and test in your laptop and Jenkins
Virtualization, Containers, Docker and scalable container management services
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
Docker and kubernetes

Recently uploaded (20)

PDF
Website Design Services for Small Businesses.pdf
PPTX
CNN LeNet5 Architecture: Neural Networks
PDF
MCP Security Tutorial - Beginner to Advanced
DOCX
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
PDF
Topaz Photo AI Crack New Download (Latest 2025)
PPTX
"Secure File Sharing Solutions on AWS".pptx
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
Computer Software - Technology and Livelihood Education
PPTX
Introduction to Windows Operating System
PDF
CCleaner 6.39.11548 Crack 2025 License Key
PDF
AI Guide for Business Growth - Arna Softech
PDF
Microsoft Office 365 Crack Download Free
PDF
Cost to Outsource Software Development in 2025
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PPTX
Patient Appointment Booking in Odoo with online payment
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)
Website Design Services for Small Businesses.pdf
CNN LeNet5 Architecture: Neural Networks
MCP Security Tutorial - Beginner to Advanced
Modern SharePoint Intranet Templates That Boost Employee Engagement in 2025.docx
Topaz Photo AI Crack New Download (Latest 2025)
"Secure File Sharing Solutions on AWS".pptx
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
Computer Software - Technology and Livelihood Education
Introduction to Windows Operating System
CCleaner 6.39.11548 Crack 2025 License Key
AI Guide for Business Growth - Arna Softech
Microsoft Office 365 Crack Download Free
Cost to Outsource Software Development in 2025
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Patient Appointment Booking in Odoo with online payment
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
Multiverse AI Review 2025: Access All TOP AI Model-Versions!
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Ableton Live Suite for MacOS Crack Full Download (Latest 2025)

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