SlideShare a Scribd company logo
1 of 56
Download to read offline
Another introduction to Docker
Tibor Vass
Who Am I?
• Core maintainer on Docker Engine

• Previously Ops @ StumbleUpon

• I ♡ Go

2
Tibor Vass, Chapel Hill, NC
IRC #docker: tibor
Twitter: @tiborvass
Outline
• Challenges
• What’s needed
• What is Docker
• Getting started
• Docker concepts
– Engine
– Images & Containers
– Builds
– Compose
• Deployment Workflow
3
Challenges
1. Deployment & Guarantees
1. Separation of concerns (Dev vs Ops)
Code deployment…
7
CI fetches code
builds it and runs tests
If ok, allow deployment of code
push code to git server
Prod
Deploy code
hook
kicks CI
… in different environments!
8
Newest version of Python
Code assumes port 1234 available
Older version of Python
Port 1234 taken
Missing dependency
… in different environments!
9
Newest version of Python
Code assumes port 1234 available
Older version of Python
Port 1234 taken
Missing dependency
Angry
Users
… in different environments!
10
Newest version of Python
Code assumes port 1234 available
Older version of Python
Port 1234 taken
Missing dependency
Angry
Users
“Works for me!”
11
Code deployment
12
Code deployment
13
Code deployment
Need “Code + environment” deployment
14
Code deployment
Need “Code + environment” deployment
Need a portable unit of deployment
(guaranteed to work everywhere)
15
Virtual Machines?
2. Density & Resource usage
Density & Resource usage
• One app per server
– waste of idle resources
– huge costs
• One app per VM, multiple VMs per server
– Better resource pooling
– Easier to scale
– Pay as you go (cloud)
– Not *that* portable
– Requires resource allocation

(cpu, RAM, disk, …)
– GuestOS duplicated
– Resource hungry
17 Hardware
Host OS
Hypervisor
GuestOS GuestOS
AppApp
Hardware
Host OS
App
3. Move fast, and don’t break things
19
Make your product better faster (stronger♫)
to gain competitive advantage
What’s needed
What’s needed
• Something like VMs…
• Isolates processes from storage, networking, memory, cpu (sandboxing)
• …but lighter
• Lightweight portable unit of deployment (packaging & distribution)
21
22
Docker container/image
23
Hardware
Host OS
App App App
24
Hardware
Host OS
Hardware
Host OS
Hypervisor
GuestOS GuestOS
code
bins/libs
code
bins/libs
code code code
bins/libsshared bins/libs
As many shared
layers as possible
VM Container
VM vs Container
What is Docker?
Challenge #0: Satisfying Users’
expectation of reliability and availability
27
Dream: what if, you could build distributed apps

easily, and focus on your product?
28
Distributed and scalable services gotta be
independent from the machines they run on
29
Containers are part of the answer
30
Docker’s greatest value does not lie

in its technology
31
It lies in its ability to get people

agree on something
32
Open platform inviting you to
help make the dream happen
33
Or simply enjoy and contribute to
each independent piece along the way
Docker
• Engine
• Hub
• Distribution (Private registry)
• Machine
• Compose
• Swarm
• Kitematic
• More to come…
34
Getting Started
36
Install Docker:
https://docs.docker.com/installation/
37
(install Machine and Compose as well)
Docker concepts
1. Engine
Engine
• Docker Daemon + REST(ish) API
• Docker Client (CLI) talks to the API

• Daemon manages the Docker containers
• Start it with: docker -d
• docker version to test if docker is set up correctly
40
2. Images & Containers
Images vs Containers
• Images: About storing or moving your app
• Containers: About running your app
42
Image
• Read-only snapshots (templates) for creating containers
• Stored on the Docker Hub or on a private registry (or in a tar archive)
• Cannot be run, has to be instantiated into a container
• Look around on Docker Hub for existing images
• List images:

docker images
• Download busybox:

docker pull busybox
• Remove busybox image:

docker rmi busybox
43
Containers
• Sandboxed application
• docker ps
• docker create —name hello busybox echo hello posscon
• docker start -a hello
• docker start -a hello # same container started again
• docker rm hello
• docker run busybox echo hello posscon
• WARNING: run = create + start, so each “run” spawns a new container
(ephemeral)
44
Containers
• Launch an interactive shell:

docker run -i -t busybox sh
• Expose ports of an image:

docker run -P training/webapp python app.py
• Read host port on docker ps
• Detached mode:

docker run -d -P training/webapp python app.py
• Expose to specific host ports:

docker run -d -p 1234:5000 training/webapp python
app.py
45
3. Builds aka Dockerizing
Build images
• Example layout of a Dockerfile placed alongside with the code

• FROM ubuntu:14.04
• RUN apt-get update && apt-get install -y golang
• ENV GOPATH=/go
• COPY . /go/src/myapp
• EXPOSE 8080
• RUN go build myapp
• CMD [“/go/bin/myapp”]
• Build new image named myapp: docker build -t myapp .
• Change code, and rerun the build command: notice that Docker cached the dependencies and
won’t fetch them again by default (use —no-cache if desired)
47
Build with official images
• No need to use FROM ubuntu and install common dependencies anymore!
• Use official golang image:
• FROM golang
• COPY . /go/src/myapp
• …
• Even simpler:
• FROM golang:onbuild
• # something will listen on port 8080
• EXPOSE 8080
48
4. Compose
Compose your stack of containers
• In a docker-compose.yml:
• wordpress:
• image: wordpress
• links:
• - db:mysql
• ports:
• - 8080:80
• db:
• image: mariadb
• environment:
• MYSQL_ROOT_PASSWORD: example
• docker-compose up
• http://<IP>:8080 where IP is the IP of the Docker daemon
50
Deployment Workflow
App deployment…
52
CI fetches code
builds an IMAGE on which it runs tests
push code to git server
hook
kicks CI
Prod
Docker Hub or

private registry
If ok, push
IMAGE to
registry
Deploy IMAGE
… in different environments!
53
Dockerfile described the Docker

image with its dependencies and

Dev tested his code in that Docker image
Same Dockerfile
Same Docker image
Docker image safely

stored and tagged
Learn more
Learn more
• https://docs.docker.com/
• swarm
• security
• machine
• volumes
• exec
• logging
• monitoring
55
THANK YOU

More Related Content

What's hot

Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionPeng Xiao
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with DockerRavindu Fernando
 
Docker introduction
Docker introductionDocker introduction
Docker introductionPhuc Nguyen
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersYajushi Srivastava
 
Docker introduction &amp; benefits
Docker introduction &amp; benefitsDocker introduction &amp; benefits
Docker introduction &amp; benefitsAmit Manwade
 
Docker introduction
Docker introductionDocker introduction
Docker introductiondotCloud
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerLuong Vo
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerAditya Konarde
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerJohn Willis
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Herofazalraja
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionRobert Reiz
 
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...Simplilearn
 
Docker 101 - Getting started
Docker 101 - Getting startedDocker 101 - Getting started
Docker 101 - Getting startedMatheus Marabesi
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker IntroductionSparkbit
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)Gourav Varma
 
Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker, Inc.
 

What's hot (20)

Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 
What is Docker
What is DockerWhat is Docker
What is Docker
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Docker in real life
Docker in real lifeDocker in real life
Docker in real life
 
Docker
DockerDocker
Docker
 
Docker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and ContainersDocker 101 : Introduction to Docker and Containers
Docker 101 : Introduction to Docker and Containers
 
Docker
DockerDocker
Docker
 
Docker introduction &amp; benefits
Docker introduction &amp; benefitsDocker introduction &amp; benefits
Docker introduction &amp; benefits
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Hero
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
What Is A Docker Container? | Docker Container Tutorial For Beginners| Docker...
 
Docker 101 - Getting started
Docker 101 - Getting startedDocker 101 - Getting started
Docker 101 - Getting started
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
 
Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad Docker Compose by Aanand Prasad
Docker Compose by Aanand Prasad
 

Similar to Docker 101: An Introduction

Dockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec KraloveDockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec Kralovedamovsky
 
Dockerize the World
Dockerize the WorldDockerize the World
Dockerize the Worlddamovsky
 
Docker, how to use it. organize a meeting with IBM products...
Docker, how to use it. organize a meeting with IBM products...Docker, how to use it. organize a meeting with IBM products...
Docker, how to use it. organize a meeting with IBM products...Andrea Fontana
 
docker : how to deploy Digital Experience in a container drinking a cup of co...
docker : how to deploy Digital Experience in a container drinking a cup of co...docker : how to deploy Digital Experience in a container drinking a cup of co...
docker : how to deploy Digital Experience in a container drinking a cup of co...Matteo Bisi
 
.docker : how to deploy Digital Experience in a container drinking a cup of c...
.docker : how to deploy Digital Experience in a container drinking a cup of c....docker : how to deploy Digital Experience in a container drinking a cup of c...
.docker : how to deploy Digital Experience in a container drinking a cup of c...Andrea Fontana
 
Docker 101 - Zaragoza Docker Meetup - Universidad de Zaragoza
Docker 101 - Zaragoza Docker Meetup - Universidad de ZaragozaDocker 101 - Zaragoza Docker Meetup - Universidad de Zaragoza
Docker 101 - Zaragoza Docker Meetup - Universidad de ZaragozaAngel Borroy López
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochraneDocker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochranedotCloud
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDocker, Inc.
 
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...Ambassador Labs
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsRamit Surana
 
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERContinuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERIndrajit Poddar
 

Similar to Docker 101: An Introduction (20)

Dockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec KraloveDockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec Kralove
 
Docker basic
Docker basicDocker basic
Docker basic
 
Docker
DockerDocker
Docker
 
Dockerize the World
Dockerize the WorldDockerize the World
Dockerize the World
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Containerization using docker and its applications
Containerization using docker and its applicationsContainerization using docker and its applications
Containerization using docker and its applications
 
Docker, how to use it. organize a meeting with IBM products...
Docker, how to use it. organize a meeting with IBM products...Docker, how to use it. organize a meeting with IBM products...
Docker, how to use it. organize a meeting with IBM products...
 
Docker for dev
Docker for devDocker for dev
Docker for dev
 
docker : how to deploy Digital Experience in a container drinking a cup of co...
docker : how to deploy Digital Experience in a container drinking a cup of co...docker : how to deploy Digital Experience in a container drinking a cup of co...
docker : how to deploy Digital Experience in a container drinking a cup of co...
 
.docker : how to deploy Digital Experience in a container drinking a cup of c...
.docker : how to deploy Digital Experience in a container drinking a cup of c....docker : how to deploy Digital Experience in a container drinking a cup of c...
.docker : how to deploy Digital Experience in a container drinking a cup of c...
 
Docker 101 - Zaragoza Docker Meetup - Universidad de Zaragoza
Docker 101 - Zaragoza Docker Meetup - Universidad de ZaragozaDocker 101 - Zaragoza Docker Meetup - Universidad de Zaragoza
Docker 101 - Zaragoza Docker Meetup - Universidad de Zaragoza
 
Docker for Developers
Docker for DevelopersDocker for Developers
Docker for Developers
 
Django and Docker
Django and DockerDjango and Docker
Django and Docker
 
Docker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken CochraneDocker at Djangocon 2013 | Talk by Ken Cochrane
Docker at Djangocon 2013 | Talk by Ken Cochrane
 
Up & Running with Docker
Up & Running with DockerUp & Running with Docker
Up & Running with Docker
 
DCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development PipelineDCEU 18: Building Your Development Pipeline
DCEU 18: Building Your Development Pipeline
 
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
Velocity NYC 2017: Building Resilient Microservices with Kubernetes, Docker, ...
 
Docker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and toolsDocker for the new Era: Introducing Docker,its components and tools
Docker for the new Era: Introducing Docker,its components and tools
 
Evotalks Docker Presentation
Evotalks Docker PresentationEvotalks Docker Presentation
Evotalks Docker Presentation
 
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERContinuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
 

More from POSSCON

Why Meteor.JS?
Why Meteor.JS?Why Meteor.JS?
Why Meteor.JS?POSSCON
 
Vagrant 101
Vagrant 101Vagrant 101
Vagrant 101POSSCON
 
Tools for Open Source Systems Administration
Tools for Open Source Systems AdministrationTools for Open Source Systems Administration
Tools for Open Source Systems AdministrationPOSSCON
 
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...POSSCON
 
Accelerating Application Delivery with OpenShift
Accelerating Application Delivery with OpenShiftAccelerating Application Delivery with OpenShift
Accelerating Application Delivery with OpenShiftPOSSCON
 
Openstack 101
Openstack 101Openstack 101
Openstack 101POSSCON
 
Community Building: The Open Source Way
Community Building: The Open Source WayCommunity Building: The Open Source Way
Community Building: The Open Source WayPOSSCON
 
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP AnywayI Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP AnywayPOSSCON
 
Software Defined Networking (SDN) for the Datacenter
Software Defined Networking (SDN) for the DatacenterSoftware Defined Networking (SDN) for the Datacenter
Software Defined Networking (SDN) for the DatacenterPOSSCON
 
Application Security on a Dime: A Practical Guide to Using Functional Open So...
Application Security on a Dime: A Practical Guide to Using Functional Open So...Application Security on a Dime: A Practical Guide to Using Functional Open So...
Application Security on a Dime: A Practical Guide to Using Functional Open So...POSSCON
 
Why Your Open Source Story Matters
Why Your Open Source Story MattersWhy Your Open Source Story Matters
Why Your Open Source Story MattersPOSSCON
 
How YARN Enables Multiple Data Processing Engines in Hadoop
How YARN Enables Multiple Data Processing Engines in HadoopHow YARN Enables Multiple Data Processing Engines in Hadoop
How YARN Enables Multiple Data Processing Engines in HadoopPOSSCON
 
Google Summer of Code
Google Summer of CodeGoogle Summer of Code
Google Summer of CodePOSSCON
 
Introduction to Hadoop
Introduction to HadoopIntroduction to Hadoop
Introduction to HadoopPOSSCON
 
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...POSSCON
 
Cyber Security and Open Source
Cyber Security and Open SourceCyber Security and Open Source
Cyber Security and Open SourcePOSSCON
 
Intro to AngularJS
Intro to AngularJSIntro to AngularJS
Intro to AngularJSPOSSCON
 
Graph the Planet!
Graph the Planet!Graph the Planet!
Graph the Planet!POSSCON
 
Software Freedom Licensing: What You Must Know
Software Freedom Licensing: What You Must KnowSoftware Freedom Licensing: What You Must Know
Software Freedom Licensing: What You Must KnowPOSSCON
 
Contributing to an Open Source Project 101
Contributing to an Open Source Project 101Contributing to an Open Source Project 101
Contributing to an Open Source Project 101POSSCON
 

More from POSSCON (20)

Why Meteor.JS?
Why Meteor.JS?Why Meteor.JS?
Why Meteor.JS?
 
Vagrant 101
Vagrant 101Vagrant 101
Vagrant 101
 
Tools for Open Source Systems Administration
Tools for Open Source Systems AdministrationTools for Open Source Systems Administration
Tools for Open Source Systems Administration
 
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
 
Accelerating Application Delivery with OpenShift
Accelerating Application Delivery with OpenShiftAccelerating Application Delivery with OpenShift
Accelerating Application Delivery with OpenShift
 
Openstack 101
Openstack 101Openstack 101
Openstack 101
 
Community Building: The Open Source Way
Community Building: The Open Source WayCommunity Building: The Open Source Way
Community Building: The Open Source Way
 
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP AnywayI Know It Was MEAN, But I Cut the Cord to LAMP Anyway
I Know It Was MEAN, But I Cut the Cord to LAMP Anyway
 
Software Defined Networking (SDN) for the Datacenter
Software Defined Networking (SDN) for the DatacenterSoftware Defined Networking (SDN) for the Datacenter
Software Defined Networking (SDN) for the Datacenter
 
Application Security on a Dime: A Practical Guide to Using Functional Open So...
Application Security on a Dime: A Practical Guide to Using Functional Open So...Application Security on a Dime: A Practical Guide to Using Functional Open So...
Application Security on a Dime: A Practical Guide to Using Functional Open So...
 
Why Your Open Source Story Matters
Why Your Open Source Story MattersWhy Your Open Source Story Matters
Why Your Open Source Story Matters
 
How YARN Enables Multiple Data Processing Engines in Hadoop
How YARN Enables Multiple Data Processing Engines in HadoopHow YARN Enables Multiple Data Processing Engines in Hadoop
How YARN Enables Multiple Data Processing Engines in Hadoop
 
Google Summer of Code
Google Summer of CodeGoogle Summer of Code
Google Summer of Code
 
Introduction to Hadoop
Introduction to HadoopIntroduction to Hadoop
Introduction to Hadoop
 
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
How to Use Cryptography Properly: The Common Mistakes People Make When Using ...
 
Cyber Security and Open Source
Cyber Security and Open SourceCyber Security and Open Source
Cyber Security and Open Source
 
Intro to AngularJS
Intro to AngularJSIntro to AngularJS
Intro to AngularJS
 
Graph the Planet!
Graph the Planet!Graph the Planet!
Graph the Planet!
 
Software Freedom Licensing: What You Must Know
Software Freedom Licensing: What You Must KnowSoftware Freedom Licensing: What You Must Know
Software Freedom Licensing: What You Must Know
 
Contributing to an Open Source Project 101
Contributing to an Open Source Project 101Contributing to an Open Source Project 101
Contributing to an Open Source Project 101
 

Recently uploaded

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 

Recently uploaded (20)

08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 

Docker 101: An Introduction

  • 1. Another introduction to Docker Tibor Vass
  • 2. Who Am I? • Core maintainer on Docker Engine
 • Previously Ops @ StumbleUpon
 • I ♡ Go
 2 Tibor Vass, Chapel Hill, NC IRC #docker: tibor Twitter: @tiborvass
  • 3. Outline • Challenges • What’s needed • What is Docker • Getting started • Docker concepts – Engine – Images & Containers – Builds – Compose • Deployment Workflow 3
  • 5. 1. Deployment & Guarantees
  • 6. 1. Separation of concerns (Dev vs Ops)
  • 7. Code deployment… 7 CI fetches code builds it and runs tests If ok, allow deployment of code push code to git server Prod Deploy code hook kicks CI
  • 8. … in different environments! 8 Newest version of Python Code assumes port 1234 available Older version of Python Port 1234 taken Missing dependency
  • 9. … in different environments! 9 Newest version of Python Code assumes port 1234 available Older version of Python Port 1234 taken Missing dependency Angry Users
  • 10. … in different environments! 10 Newest version of Python Code assumes port 1234 available Older version of Python Port 1234 taken Missing dependency Angry Users “Works for me!”
  • 13. 13 Code deployment Need “Code + environment” deployment
  • 14. 14 Code deployment Need “Code + environment” deployment Need a portable unit of deployment (guaranteed to work everywhere)
  • 16. 2. Density & Resource usage
  • 17. Density & Resource usage • One app per server – waste of idle resources – huge costs • One app per VM, multiple VMs per server – Better resource pooling – Easier to scale – Pay as you go (cloud) – Not *that* portable – Requires resource allocation
 (cpu, RAM, disk, …) – GuestOS duplicated – Resource hungry 17 Hardware Host OS Hypervisor GuestOS GuestOS AppApp Hardware Host OS App
  • 18. 3. Move fast, and don’t break things
  • 19. 19 Make your product better faster (stronger♫) to gain competitive advantage
  • 21. What’s needed • Something like VMs… • Isolates processes from storage, networking, memory, cpu (sandboxing) • …but lighter • Lightweight portable unit of deployment (packaging & distribution) 21
  • 24. 24 Hardware Host OS Hardware Host OS Hypervisor GuestOS GuestOS code bins/libs code bins/libs code code code bins/libsshared bins/libs As many shared layers as possible VM Container VM vs Container
  • 26. Challenge #0: Satisfying Users’ expectation of reliability and availability
  • 27. 27 Dream: what if, you could build distributed apps
 easily, and focus on your product?
  • 28. 28 Distributed and scalable services gotta be independent from the machines they run on
  • 29. 29 Containers are part of the answer
  • 30. 30 Docker’s greatest value does not lie
 in its technology
  • 31. 31 It lies in its ability to get people
 agree on something
  • 32. 32 Open platform inviting you to help make the dream happen
  • 33. 33 Or simply enjoy and contribute to each independent piece along the way
  • 34. Docker • Engine • Hub • Distribution (Private registry) • Machine • Compose • Swarm • Kitematic • More to come… 34
  • 37. 37 (install Machine and Compose as well)
  • 40. Engine • Docker Daemon + REST(ish) API • Docker Client (CLI) talks to the API
 • Daemon manages the Docker containers • Start it with: docker -d • docker version to test if docker is set up correctly 40
  • 41. 2. Images & Containers
  • 42. Images vs Containers • Images: About storing or moving your app • Containers: About running your app 42
  • 43. Image • Read-only snapshots (templates) for creating containers • Stored on the Docker Hub or on a private registry (or in a tar archive) • Cannot be run, has to be instantiated into a container • Look around on Docker Hub for existing images • List images:
 docker images • Download busybox:
 docker pull busybox • Remove busybox image:
 docker rmi busybox 43
  • 44. Containers • Sandboxed application • docker ps • docker create —name hello busybox echo hello posscon • docker start -a hello • docker start -a hello # same container started again • docker rm hello • docker run busybox echo hello posscon • WARNING: run = create + start, so each “run” spawns a new container (ephemeral) 44
  • 45. Containers • Launch an interactive shell:
 docker run -i -t busybox sh • Expose ports of an image:
 docker run -P training/webapp python app.py • Read host port on docker ps • Detached mode:
 docker run -d -P training/webapp python app.py • Expose to specific host ports:
 docker run -d -p 1234:5000 training/webapp python app.py 45
  • 46. 3. Builds aka Dockerizing
  • 47. Build images • Example layout of a Dockerfile placed alongside with the code
 • FROM ubuntu:14.04 • RUN apt-get update && apt-get install -y golang • ENV GOPATH=/go • COPY . /go/src/myapp • EXPOSE 8080 • RUN go build myapp • CMD [“/go/bin/myapp”] • Build new image named myapp: docker build -t myapp . • Change code, and rerun the build command: notice that Docker cached the dependencies and won’t fetch them again by default (use —no-cache if desired) 47
  • 48. Build with official images • No need to use FROM ubuntu and install common dependencies anymore! • Use official golang image: • FROM golang • COPY . /go/src/myapp • … • Even simpler: • FROM golang:onbuild • # something will listen on port 8080 • EXPOSE 8080 48
  • 50. Compose your stack of containers • In a docker-compose.yml: • wordpress: • image: wordpress • links: • - db:mysql • ports: • - 8080:80 • db: • image: mariadb • environment: • MYSQL_ROOT_PASSWORD: example • docker-compose up • http://<IP>:8080 where IP is the IP of the Docker daemon 50
  • 52. App deployment… 52 CI fetches code builds an IMAGE on which it runs tests push code to git server hook kicks CI Prod Docker Hub or
 private registry If ok, push IMAGE to registry Deploy IMAGE
  • 53. … in different environments! 53 Dockerfile described the Docker
 image with its dependencies and
 Dev tested his code in that Docker image Same Dockerfile Same Docker image Docker image safely
 stored and tagged
  • 55. Learn more • https://docs.docker.com/ • swarm • security • machine • volumes • exec • logging • monitoring 55