SlideShare a Scribd company logo
Docker 101 
An Introduction to Containerizing Apps 
Benjamin Schmidt 
kWantera.com CTO
Agenda 
● What is Docker? 
● Using Docker 
● What can you do with Docker? 
● Examples 
● Tech that extends Docker
Talk’s Purpose 
● While simple, Docker is expansive in it’s 
capabilities 
● I’d like to cover enough so people can 
understand the concepts 
● I leave it to the docs and SO for becoming 
“experts”
What is Docker? 
“open platform … to build, ship and run 
distributed applications” 
Linux virtualization made easy (and light-weight)
A Container For Your App 
● You’ve got code 
● Docker is a self-contained, customizable 
linux environment to run that code 
● It is a virtual machine without the full OS
Origins (-ish) 
● Linux containers (LXC) :: sort of like chroot 
● Create a kernel separated environment for 
security purposes 
● Since it’s part of kernel = does not require a 
full OS 
● Can run multiple containers on same system 
● Sprinkle in resource constraints 
● Add a dash of environment scripting
Representation 
You have an “App” you want 
to run: 
● Mongo server 
● HTTP server 
● Long-running script 
● An ad-hoc backup script 
image source: docker.io
Representation 
Traditionally you run it on a 
“full server” 
image source: docker.io 
Required 
libraries 
The physical 
hardware
Representation 
Virtualization solved the 
multiple-app / library 
problem 
● Still a single physical hardware server 
image source: docker.io 
Use Virtualization to 
mirror the “physical” 
hardware at OS level
Representation 
Some inefficiencies pop-up 
● Architecture duplication 
● Setting up “fully systems” 
=> Leads to resource waste 
image source: docker.io 
HEAVY copying & 
redundancy 
Potentially 
redundant
Representation 
Docker Solution 
● There is only one running “full OS” 
o You use a dedicated portion of kernel 
resources 
● Much lighter weight leads to: 
o Easily cloneable containers 
o Sharing system libraries versus program 
libraries (i.e. a portion of the host kernel) 
image source: docker.io
Terminology 
● Container 
o Runs your code using a specified environment 
(Image) and the command you wish to execute in 
that environment 
● Image 
o An environment complete with the type of OS and 
any setup instructions for generating that 
environment
Using Docker 
● Docker has a pretty simple command line 
API* 
o run: converts images and commands into containers 
o start/stop: starts or stops containers 
o ps: inspect the available containers and their status 
o images: list all available images (locally 
downloaded) 
o build: builds image (e.x from a Dockerfile) 
*Other commands exist for more fine-grained control and inspection
At this point... 
● I want to give a flavor for Docker usage 
without all the details 
o See the Docs for extensive coverage 
o This is just a 101 course :)
Let’s start a docker container... 
$ sudo docker run ubuntu:14.04 /bin/echo ‘Hello World’ 
Hello World
Let’s start a docker container... 
Accesses LXC 
under the hood 
(needs root) 
The type of 
Image 
Convert from 
Image to 
Container 
The command to 
run in that image 
type 
$ sudo docker run ubuntu:14.04 /bin/echo ‘Hello World’ 
Hello World
And if you wanted to test in multiple 
OS’s... 
$ sudo docker run ubuntu:14.04 /bin/echo ‘Hello World’ 
Hello World 
$ sudo docker run ubuntu /bin/echo ‘Hello World’ 
Hello World 
$ sudo docker run centos /bin/echo ‘Hello World’ 
Hello World 
$ sudo docker run debian /bin/echo ‘Hello World’ 
Hello World
A few notes 
● Program printed to STDOUT (the console) 
● If you run `sudo docker ps` you won’t see 
any currently running containers (it stopped) 
● Running `sudo docker ps -a` will show a 
stopped container
And if you want an interactive shell... 
$ sudo docker run -t -i ubuntu:14.04 /bin/bash 
root@ae23f43: | 
-t = pseudo-tty 
terminal 
-i = interactive (STDIN is 
piped into process)
And if you want an interactive shell... 
$ sudo docker run -t -i ubuntu:14.04 /bin/bash 
root@ae23f43: | 
And to know you’re not in a full OS, try 
`top`... only two processes
And throw a process into 
background... 
$ sudo docker run -d ubuntu /bin/sh -c "while true; do echo hello world; sleep 1; 
done" 
1e5535038e285177d5214659a068137486f96ee5c2e85a4ac52dc83f2ebe4147 
-d = daemonize 
leaving off :14.04 provides 
the “latest” version 
Returns the 
container ID
Bind ports inside container to host... 
$ sudo docker run -d -p 5000:5000 ubuntu python myserver.py 
-p = port mapping. 
(lower case) 
Inside:Outside
Dockerfile 
Create Images # Put this in a file called Dockerfile 
FROM ubuntu 
MAINTAINER Ben Schmidt <ben@example.com> 
RUN apt-get update 
$ cd ~/myserver 
$ sudo docker build -t=”myimage” . 
$ sudo docker run -i -it myimage /bin/bash 
A Dockerfile in ~/myimage/ 
-t = Set the name of the 
image
Things to be Aware of... 
● Containers run in their own environment 
o Files, ports, and host data must be “mapped” to the 
container 
o EXPOSE: exposes ports to host 
o ADD: copies local host files into container 
● Volumes allow exposure of host OS 
filesystem to containers 
o Can get very tricky! But allows shared storage and 
even containers that act as storage only
Things to be Aware of... 
● Images are stored with a VCS-ish 
o Each line in a Dockerfile creates a new image 
o FROM command allows stacking of images 
o Can create parent-child relationships 
o sudo docker commit or pull 
● Docker Hub 
o Store your images in the cloud 
o This is default how we access many of the common 
images (ubuntu, centos etc.) 
o Can also create your own private repository
Things to be Aware of... 
● Resource limits 
o Can set CPU and RAM limits 
● Networking 
o Docker creates an elaborate networking 
infrastructure via clever use of /etc/hosts 
o Do not modify /etc/hosts!! or do so at peril
Neat tech out there today... 
Docker swarm: 
https://github.com/docker/swarm 
CoreOS Rocket: 
https://github.com/coreos/rocket
Thanks!! 
Contact: 
Ben Schmidt 
kwantera.com

More Related Content

What's hot

Docker Ecosystem: Part V - Docker Registry
Docker Ecosystem: Part V - Docker RegistryDocker Ecosystem: Part V - Docker Registry
Docker Ecosystem: Part V - Docker Registry
Mario IC
 
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet
 
Docker hands-on
Docker hands-onDocker hands-on
Docker hands-on
Dharmit Shah
 
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps ItaliaWhen Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
Giovanni Toraldo
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Kevin Littlejohn
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
Binary Studio
 
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
dotCloud
 
Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4
Binary Studio
 
Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作
kao kuo-tung
 
Docker slides
Docker slidesDocker slides
Docker slides
Ayla Khan
 
Virtual Machines and Docker
Virtual Machines and DockerVirtual Machines and Docker
Virtual Machines and Docker
Danish Khakwani
 
Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1
Binary Studio
 
Docker - A Ruby Introduction
Docker - A Ruby IntroductionDocker - A Ruby Introduction
Docker - A Ruby Introduction
Tyler Johnston
 
Dockerandjenkins citz2014
Dockerandjenkins citz2014Dockerandjenkins citz2014
Dockerandjenkins citz2014
Martin Kenneth Michalsky
 
Docker presentation | Paris Docker Meetup
Docker presentation | Paris Docker MeetupDocker presentation | Paris Docker Meetup
Docker presentation | Paris Docker Meetup
dotCloud
 
Dockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at RackspaceDockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at Rackspace
dotCloud
 
Docker Cheatsheet_01
Docker Cheatsheet_01Docker Cheatsheet_01
Docker Cheatsheet_01
Infralovers
 
Docker orchestration using core os and ansible - Ansible IL 2015
Docker orchestration using core os and ansible - Ansible IL 2015Docker orchestration using core os and ansible - Ansible IL 2015
Docker orchestration using core os and ansible - Ansible IL 2015
Leonid Mirsky
 
Launching containers with fleet
Launching containers with fleetLaunching containers with fleet
Launching containers with fleet
충섭 김
 
Docker 101
Docker 101Docker 101
Docker 101
NSConclave
 

What's hot (20)

Docker Ecosystem: Part V - Docker Registry
Docker Ecosystem: Part V - Docker RegistryDocker Ecosystem: Part V - Docker Registry
Docker Ecosystem: Part V - Docker Registry
 
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
Puppet Camp Chicago 2014: Docker and Puppet: 1+1=3 (Intermediate)
 
Docker hands-on
Docker hands-onDocker hands-on
Docker hands-on
 
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps ItaliaWhen Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
When Docker ends, Chef begins ~ #idi2015 Incontro DevOps Italia
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
 
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
Dockerfile Basics | Docker workshop #2 at twitter, 2013-11-05
 
Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4
 
Docker 原理與實作
Docker 原理與實作Docker 原理與實作
Docker 原理與實作
 
Docker slides
Docker slidesDocker slides
Docker slides
 
Virtual Machines and Docker
Virtual Machines and DockerVirtual Machines and Docker
Virtual Machines and Docker
 
Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1Academy PRO: Docker. Part 1
Academy PRO: Docker. Part 1
 
Docker - A Ruby Introduction
Docker - A Ruby IntroductionDocker - A Ruby Introduction
Docker - A Ruby Introduction
 
Dockerandjenkins citz2014
Dockerandjenkins citz2014Dockerandjenkins citz2014
Dockerandjenkins citz2014
 
Docker presentation | Paris Docker Meetup
Docker presentation | Paris Docker MeetupDocker presentation | Paris Docker Meetup
Docker presentation | Paris Docker Meetup
 
Dockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at RackspaceDockerfile basics | docker workshop #1 at Rackspace
Dockerfile basics | docker workshop #1 at Rackspace
 
Docker Cheatsheet_01
Docker Cheatsheet_01Docker Cheatsheet_01
Docker Cheatsheet_01
 
Docker orchestration using core os and ansible - Ansible IL 2015
Docker orchestration using core os and ansible - Ansible IL 2015Docker orchestration using core os and ansible - Ansible IL 2015
Docker orchestration using core os and ansible - Ansible IL 2015
 
Launching containers with fleet
Launching containers with fleetLaunching containers with fleet
Launching containers with fleet
 
Docker 101
Docker 101Docker 101
Docker 101
 

Similar to Docker 101

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
Guido Schmutz
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021
Alessandro Mignogna
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
IgnacioTamayo2
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
TheFamily
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
Jérôme Petazzoni
 
Docker.pdf
Docker.pdfDocker.pdf
Docker.pdf
UsamaMushtaq24
 
Introduction to Docker - Learning containerization XP conference 2016
Introduction to Docker - Learning containerization  XP conference 2016Introduction to Docker - Learning containerization  XP conference 2016
Introduction to Docker - Learning containerization XP conference 2016
XP Conference India
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
Carlo Bonamico
 
Docker 2014
Docker 2014Docker 2014
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
Henryk Konsek
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
Patrick Chanezon
 
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
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbies
Yigal Elefant
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and Containers
Docker, Inc.
 
Docker
DockerDocker
Docker
Brian Hogan
 
Introduction To Docker
Introduction To DockerIntroduction To Docker
Introduction To Docker
Hamilton Turner
 
Docker presentation
Docker presentationDocker presentation
Docker presentation
Jaskaran Singh
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
DuckDuckGo
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
Araf Karsh Hamid
 
Docker 101
Docker 101 Docker 101
Docker 101
Kevin Nord
 

Similar to Docker 101 (20)

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
 
Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021Primi passi con Docker - ItalianCoders - 12-01-2021
Primi passi con Docker - ItalianCoders - 12-01-2021
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
 
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme PetazzoniWorkshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
Workshop : 45 minutes pour comprendre Docker avec Jérôme Petazzoni
 
Introduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" EditionIntroduction to Docker, December 2014 "Tour de France" Edition
Introduction to Docker, December 2014 "Tour de France" Edition
 
Docker.pdf
Docker.pdfDocker.pdf
Docker.pdf
 
Introduction to Docker - Learning containerization XP conference 2016
Introduction to Docker - Learning containerization  XP conference 2016Introduction to Docker - Learning containerization  XP conference 2016
Introduction to Docker - Learning containerization XP conference 2016
 
codemotion-docker-2014
codemotion-docker-2014codemotion-docker-2014
codemotion-docker-2014
 
Docker 2014
Docker 2014Docker 2014
Docker 2014
 
Docker for mere mortals
Docker for mere mortalsDocker for mere mortals
Docker for mere mortals
 
Docker Ecosystem on Azure
Docker Ecosystem on AzureDocker Ecosystem on Azure
Docker Ecosystem on Azure
 
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...
 
Hands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbiesHands on introduction to docker security for docker newbies
Hands on introduction to docker security for docker newbies
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and Containers
 
Docker
DockerDocker
Docker
 
Introduction To Docker
Introduction To DockerIntroduction To Docker
Introduction To Docker
 
Docker presentation
Docker presentationDocker presentation
Docker presentation
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
Docker 101
Docker 101 Docker 101
Docker 101
 

Recently uploaded

GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 

Recently uploaded (20)

GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 

Docker 101

  • 1. Docker 101 An Introduction to Containerizing Apps Benjamin Schmidt kWantera.com CTO
  • 2. Agenda ● What is Docker? ● Using Docker ● What can you do with Docker? ● Examples ● Tech that extends Docker
  • 3. Talk’s Purpose ● While simple, Docker is expansive in it’s capabilities ● I’d like to cover enough so people can understand the concepts ● I leave it to the docs and SO for becoming “experts”
  • 4. What is Docker? “open platform … to build, ship and run distributed applications” Linux virtualization made easy (and light-weight)
  • 5. A Container For Your App ● You’ve got code ● Docker is a self-contained, customizable linux environment to run that code ● It is a virtual machine without the full OS
  • 6. Origins (-ish) ● Linux containers (LXC) :: sort of like chroot ● Create a kernel separated environment for security purposes ● Since it’s part of kernel = does not require a full OS ● Can run multiple containers on same system ● Sprinkle in resource constraints ● Add a dash of environment scripting
  • 7. Representation You have an “App” you want to run: ● Mongo server ● HTTP server ● Long-running script ● An ad-hoc backup script image source: docker.io
  • 8. Representation Traditionally you run it on a “full server” image source: docker.io Required libraries The physical hardware
  • 9. Representation Virtualization solved the multiple-app / library problem ● Still a single physical hardware server image source: docker.io Use Virtualization to mirror the “physical” hardware at OS level
  • 10. Representation Some inefficiencies pop-up ● Architecture duplication ● Setting up “fully systems” => Leads to resource waste image source: docker.io HEAVY copying & redundancy Potentially redundant
  • 11. Representation Docker Solution ● There is only one running “full OS” o You use a dedicated portion of kernel resources ● Much lighter weight leads to: o Easily cloneable containers o Sharing system libraries versus program libraries (i.e. a portion of the host kernel) image source: docker.io
  • 12. Terminology ● Container o Runs your code using a specified environment (Image) and the command you wish to execute in that environment ● Image o An environment complete with the type of OS and any setup instructions for generating that environment
  • 13. Using Docker ● Docker has a pretty simple command line API* o run: converts images and commands into containers o start/stop: starts or stops containers o ps: inspect the available containers and their status o images: list all available images (locally downloaded) o build: builds image (e.x from a Dockerfile) *Other commands exist for more fine-grained control and inspection
  • 14. At this point... ● I want to give a flavor for Docker usage without all the details o See the Docs for extensive coverage o This is just a 101 course :)
  • 15. Let’s start a docker container... $ sudo docker run ubuntu:14.04 /bin/echo ‘Hello World’ Hello World
  • 16. Let’s start a docker container... Accesses LXC under the hood (needs root) The type of Image Convert from Image to Container The command to run in that image type $ sudo docker run ubuntu:14.04 /bin/echo ‘Hello World’ Hello World
  • 17. And if you wanted to test in multiple OS’s... $ sudo docker run ubuntu:14.04 /bin/echo ‘Hello World’ Hello World $ sudo docker run ubuntu /bin/echo ‘Hello World’ Hello World $ sudo docker run centos /bin/echo ‘Hello World’ Hello World $ sudo docker run debian /bin/echo ‘Hello World’ Hello World
  • 18. A few notes ● Program printed to STDOUT (the console) ● If you run `sudo docker ps` you won’t see any currently running containers (it stopped) ● Running `sudo docker ps -a` will show a stopped container
  • 19. And if you want an interactive shell... $ sudo docker run -t -i ubuntu:14.04 /bin/bash root@ae23f43: | -t = pseudo-tty terminal -i = interactive (STDIN is piped into process)
  • 20. And if you want an interactive shell... $ sudo docker run -t -i ubuntu:14.04 /bin/bash root@ae23f43: | And to know you’re not in a full OS, try `top`... only two processes
  • 21. And throw a process into background... $ sudo docker run -d ubuntu /bin/sh -c "while true; do echo hello world; sleep 1; done" 1e5535038e285177d5214659a068137486f96ee5c2e85a4ac52dc83f2ebe4147 -d = daemonize leaving off :14.04 provides the “latest” version Returns the container ID
  • 22. Bind ports inside container to host... $ sudo docker run -d -p 5000:5000 ubuntu python myserver.py -p = port mapping. (lower case) Inside:Outside
  • 23. Dockerfile Create Images # Put this in a file called Dockerfile FROM ubuntu MAINTAINER Ben Schmidt <ben@example.com> RUN apt-get update $ cd ~/myserver $ sudo docker build -t=”myimage” . $ sudo docker run -i -it myimage /bin/bash A Dockerfile in ~/myimage/ -t = Set the name of the image
  • 24. Things to be Aware of... ● Containers run in their own environment o Files, ports, and host data must be “mapped” to the container o EXPOSE: exposes ports to host o ADD: copies local host files into container ● Volumes allow exposure of host OS filesystem to containers o Can get very tricky! But allows shared storage and even containers that act as storage only
  • 25. Things to be Aware of... ● Images are stored with a VCS-ish o Each line in a Dockerfile creates a new image o FROM command allows stacking of images o Can create parent-child relationships o sudo docker commit or pull ● Docker Hub o Store your images in the cloud o This is default how we access many of the common images (ubuntu, centos etc.) o Can also create your own private repository
  • 26. Things to be Aware of... ● Resource limits o Can set CPU and RAM limits ● Networking o Docker creates an elaborate networking infrastructure via clever use of /etc/hosts o Do not modify /etc/hosts!! or do so at peril
  • 27. Neat tech out there today... Docker swarm: https://github.com/docker/swarm CoreOS Rocket: https://github.com/coreos/rocket
  • 28. Thanks!! Contact: Ben Schmidt kwantera.com