SlideShare a Scribd company logo
1 of 23
Download to read offline
Docker: Up and Running
Mark Beacom
Introduction
Mark Beacom
● With Drund since July 2014
● Recently moved to DevOps from Backend
● I like coffee
● Rather be camping
What I’ll cover...
● What’s Docker?
● Benefits of Docker
● Images and Containers?
● The Docker ecosystem
● Dockerizing a flask web app
● Honorable mentions
● Live streaming: A resource intensive animal
What’s Docker?
● “Docker is the world’s leading software container platform.”
● Established in 2008
● Current release: v1.13
● Github: 43K+ Stars (now moby/moby)
● Software platform allowing for rapid build, test, and deploy of
applications
● Packages software into standardized units called containers
● Runs images of containers
● Wraps everything needed to run: code, runtime, system tools, system
libraries - anything that can be installed on a server
Benefits of Docker
● Avoid: “Works on my machine” problems when
collaborating on code
● Ship Software… Faster (7x)
● Improved Developer Productivity
● Easy deployment, scaling, and rollbacks
● Avoid: Application configuration drift
● Reusability!
Images...
● Lightweight
● Stand-alone
● Executable
● Immutable
● Created with: docker build
● Listed with: docker images
● Deployable to registries
● Generated from a Dockerfile definition
The basis of a Docker container
Containers..? What’s a container?
● Runtime instance of an image
● The standard unit where the application or service resides
● Runs completely isolated from the host environment (unless configured)
● Runs natively on the host machine’s kernel
● Created with: docker run
Docker CLI
● Listing active containers: docker ps
● Listing images: docker images
● Pulling images: docker pull alpine
○ Retrieves the alpine linux image from the Docker Hub repository
● Running an image: docker run alpine ls
○ Spins up a docker container running alpine with the ls command and returns the
response.
Dockerize a Flask webapp!
● Collect the project source - We’re using Docker’s flask app example
https://github.com/docker/labs/tree/master/beginner/flask-app
● Runs a python-based web application serving a single index template
● Defines all requirements, libraries, and configuration settings.
Anatomy of our Dockerfile
● FROM - Defines the base
● RUN - Executes commands during
the build process
● COPY - Copies file(s) to the image
● EXPOSE - Exposes the port
● CMD - The default command
executed at runtime
Initiating a Docker build...
docker build -t docker-demo .
● Results in a build with 9 steps
● Pulls the Alpine linux image from Docker
Hub
● Runs our commands
● Copies assets
● Exposes the necessary port to the host
Building the image
● Step 1: FROM alpine:latest
● Step 2: RUN apk add --update py2-pip
Building the image
● Step 3: RUN pip install --upgrade pip
● Step 4: COPY requirements.txt /usr/src/app/
Building the image
● Step 5: RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt
Building the image
● Step 6: COPY app.py /usr/src/app/
● Step 7: COPY templates/index.html /usr/src/app/templates/
● Step 8: EXPOSE 5000
Building the image
● Step 9: CMD python /usr/src/app/app.py
Running the container
● Mapping ports at runtime:
○ docker run -p 4000:5000 docker-demo
○ -p <host_port>:<container_port>
○ If no port is specified, a host port will be assigned randomly
● Naming the container for easier access and differentiation
○ docker run -p 4000:5000 --name demo docker-demo
○ --name <name>
○ If not specified, Docker will assign a random name to the container instance
Cleaning up...
● List Docker containers: docker ps
● Stop a running container: docker stop <name_or_hash>
● Remove a stopped container: docker rm <name_or_hash>
● List images: docker images
● Remove an unused image: docker rmi <name_or_hash>
A better way…
● docker run with --rm
● Automatically removes the container on exit
Live Demo
Risky business… Let’s try it out!
Honorable Mentions
● Docker Compose
○ Defining a whole containerized workload in a single file definition
● Task Schedulers and Container Orchestration
○ Marathon, Amazon ECS, Rancher, Nomad
Our use case for live streaming
● Deployed to Amazon Elastic Container Service
● Dynamically scales underlying resource pool based on utilization
● Individual transcoding containers independent for each stream
● Only use resources when the platform is in use
● Live stream capacity only limited by the maximum number of
instances we can provision on AWS
Question and Answer

More Related Content

What's hot

Docker
DockerDocker
Dockersubbul
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to DockerKuan Yen Heng
 
Virtual Machines and Docker
Virtual Machines and DockerVirtual Machines and Docker
Virtual Machines and DockerDanish Khakwani
 
Docker - Build, Ship, and Run Any App, Anywhere
Docker - Build, Ship, and Run Any App, AnywhereDocker - Build, Ship, and Run Any App, Anywhere
Docker - Build, Ship, and Run Any App, AnywhereCodibly - Software House
 
[Szjug] Docker. Does it matter for java developer?
[Szjug] Docker. Does it matter for java developer?[Szjug] Docker. Does it matter for java developer?
[Szjug] Docker. Does it matter for java developer?Izzet Mustafaiev
 
Rapid Development With Docker Compose
Rapid Development With Docker ComposeRapid Development With Docker Compose
Rapid Development With Docker ComposeJustin Crown
 
Vagrant and docker
Vagrant and dockerVagrant and docker
Vagrant and dockerDuckDuckGo
 
Docker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deploymentDocker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deploymentDegendra Sivakoti
 
Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4Binary Studio
 
Locally it worked! virtualizing docker
Locally it worked! virtualizing dockerLocally it worked! virtualizing docker
Locally it worked! virtualizing dockerSascha Brinkmann
 
Docker Compose and Panamax - ContainerDays Boston - June 2015
Docker Compose and Panamax - ContainerDays Boston - June 2015Docker Compose and Panamax - ContainerDays Boston - June 2015
Docker Compose and Panamax - ContainerDays Boston - June 2015Jonas Rosland
 
Continuous Delivery di una WebApp - by example
Continuous Delivery di una WebApp - by exampleContinuous Delivery di una WebApp - by example
Continuous Delivery di una WebApp - by exampleFabio Mora
 
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 RackspacedotCloud
 
Docker Ecosystem: Part III - Machine
Docker Ecosystem: Part III - MachineDocker Ecosystem: Part III - Machine
Docker Ecosystem: Part III - MachineMario IC
 
From Docker Run To Docker Compose
From Docker Run To Docker ComposeFrom Docker Run To Docker Compose
From Docker Run To Docker ComposeFitra Aditya
 

What's hot (20)

Docker
DockerDocker
Docker
 
Surveillance on slam technology
Surveillance on slam technologySurveillance on slam technology
Surveillance on slam technology
 
Docker e git lab
Docker e git labDocker e git lab
Docker e git lab
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 
Virtual Machines and Docker
Virtual Machines and DockerVirtual Machines and Docker
Virtual Machines and Docker
 
Docker - Build, Ship, and Run Any App, Anywhere
Docker - Build, Ship, and Run Any App, AnywhereDocker - Build, Ship, and Run Any App, Anywhere
Docker - Build, Ship, and Run Any App, Anywhere
 
[Szjug] Docker. Does it matter for java developer?
[Szjug] Docker. Does it matter for java developer?[Szjug] Docker. Does it matter for java developer?
[Szjug] Docker. Does it matter for java developer?
 
Rapid Development With Docker Compose
Rapid Development With Docker ComposeRapid Development With Docker Compose
Rapid Development With Docker Compose
 
CI-CD WITH GITLAB WORKFLOW
CI-CD WITH GITLAB WORKFLOWCI-CD WITH GITLAB WORKFLOW
CI-CD WITH GITLAB WORKFLOW
 
Lando - AddWeb Solution
Lando - AddWeb Solution Lando - AddWeb Solution
Lando - AddWeb Solution
 
Vagrant and docker
Vagrant and dockerVagrant and docker
Vagrant and docker
 
Docker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deploymentDocker session I: Continuous integration, delivery and deployment
Docker session I: Continuous integration, delivery and deployment
 
Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4Academy PRO: Docker. Part 4
Academy PRO: Docker. Part 4
 
CI CD WORKFLOW
CI CD WORKFLOWCI CD WORKFLOW
CI CD WORKFLOW
 
Locally it worked! virtualizing docker
Locally it worked! virtualizing dockerLocally it worked! virtualizing docker
Locally it worked! virtualizing docker
 
Docker Compose and Panamax - ContainerDays Boston - June 2015
Docker Compose and Panamax - ContainerDays Boston - June 2015Docker Compose and Panamax - ContainerDays Boston - June 2015
Docker Compose and Panamax - ContainerDays Boston - June 2015
 
Continuous Delivery di una WebApp - by example
Continuous Delivery di una WebApp - by exampleContinuous Delivery di una WebApp - by example
Continuous Delivery di una WebApp - by example
 
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 Ecosystem: Part III - Machine
Docker Ecosystem: Part III - MachineDocker Ecosystem: Part III - Machine
Docker Ecosystem: Part III - Machine
 
From Docker Run To Docker Compose
From Docker Run To Docker ComposeFrom Docker Run To Docker Compose
From Docker Run To Docker Compose
 

Similar to Docker Up and Running Introduction

Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tipsSamuel Chow
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxIgnacioTamayo2
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday developmentJustyna Ilczuk
 
Docker in a JS Developer’s Life
Docker in a JS Developer’s LifeDocker in a JS Developer’s Life
Docker in a JS Developer’s LifeGlobalLogic Ukraine
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Binary Studio
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerGuido Schmutz
 
Introduction of Docker and Docker Compose
Introduction of Docker and Docker ComposeIntroduction of Docker and Docker Compose
Introduction of Docker and Docker ComposeDr. Ketan Parmar
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An IntroductionPOSSCON
 
Docker slides
Docker slidesDocker slides
Docker slidesAyla Khan
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 

Similar to Docker Up and Running Introduction (20)

Docker primer and tips
Docker primer and tipsDocker primer and tips
Docker primer and tips
 
Powercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptxPowercoders · Docker · Fall 2021.pptx
Powercoders · Docker · Fall 2021.pptx
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
Docker, LinuX Container
Docker, LinuX ContainerDocker, LinuX Container
Docker, LinuX Container
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Docker in a JS Developer’s Life
Docker in a JS Developer’s LifeDocker in a JS Developer’s Life
Docker in a JS Developer’s Life
 
Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2Academy PRO: Docker. Part 2
Academy PRO: Docker. Part 2
 
Docker basic
Docker basicDocker basic
Docker basic
 
Running the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker ContainerRunning the Oracle SOA Suite Environment in a Docker Container
Running the Oracle SOA Suite Environment in a Docker Container
 
Introduction of Docker and Docker Compose
Introduction of Docker and Docker ComposeIntroduction of Docker and Docker Compose
Introduction of Docker and Docker Compose
 
DOCKER-PIAIC-SLIDES
DOCKER-PIAIC-SLIDESDOCKER-PIAIC-SLIDES
DOCKER-PIAIC-SLIDES
 
How to _docker
How to _dockerHow to _docker
How to _docker
 
Docker.pdf
Docker.pdfDocker.pdf
Docker.pdf
 
Docker presentation
Docker presentationDocker presentation
Docker presentation
 
Docker+java
Docker+javaDocker+java
Docker+java
 
Docker workshop GDSC_CSSC
Docker workshop GDSC_CSSCDocker workshop GDSC_CSSC
Docker workshop GDSC_CSSC
 
Docker 101: An Introduction
Docker 101: An IntroductionDocker 101: An Introduction
Docker 101: An Introduction
 
Docker Basics
Docker BasicsDocker Basics
Docker Basics
 
Docker slides
Docker slidesDocker slides
Docker slides
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 

Recently uploaded

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 

Recently uploaded (20)

The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 

Docker Up and Running Introduction

  • 1. Docker: Up and Running Mark Beacom
  • 2. Introduction Mark Beacom ● With Drund since July 2014 ● Recently moved to DevOps from Backend ● I like coffee ● Rather be camping
  • 3. What I’ll cover... ● What’s Docker? ● Benefits of Docker ● Images and Containers? ● The Docker ecosystem ● Dockerizing a flask web app ● Honorable mentions ● Live streaming: A resource intensive animal
  • 4. What’s Docker? ● “Docker is the world’s leading software container platform.” ● Established in 2008 ● Current release: v1.13 ● Github: 43K+ Stars (now moby/moby) ● Software platform allowing for rapid build, test, and deploy of applications ● Packages software into standardized units called containers ● Runs images of containers ● Wraps everything needed to run: code, runtime, system tools, system libraries - anything that can be installed on a server
  • 5.
  • 6. Benefits of Docker ● Avoid: “Works on my machine” problems when collaborating on code ● Ship Software… Faster (7x) ● Improved Developer Productivity ● Easy deployment, scaling, and rollbacks ● Avoid: Application configuration drift ● Reusability!
  • 7. Images... ● Lightweight ● Stand-alone ● Executable ● Immutable ● Created with: docker build ● Listed with: docker images ● Deployable to registries ● Generated from a Dockerfile definition The basis of a Docker container
  • 8. Containers..? What’s a container? ● Runtime instance of an image ● The standard unit where the application or service resides ● Runs completely isolated from the host environment (unless configured) ● Runs natively on the host machine’s kernel ● Created with: docker run
  • 9. Docker CLI ● Listing active containers: docker ps ● Listing images: docker images ● Pulling images: docker pull alpine ○ Retrieves the alpine linux image from the Docker Hub repository ● Running an image: docker run alpine ls ○ Spins up a docker container running alpine with the ls command and returns the response.
  • 10. Dockerize a Flask webapp! ● Collect the project source - We’re using Docker’s flask app example https://github.com/docker/labs/tree/master/beginner/flask-app ● Runs a python-based web application serving a single index template ● Defines all requirements, libraries, and configuration settings.
  • 11. Anatomy of our Dockerfile ● FROM - Defines the base ● RUN - Executes commands during the build process ● COPY - Copies file(s) to the image ● EXPOSE - Exposes the port ● CMD - The default command executed at runtime
  • 12. Initiating a Docker build... docker build -t docker-demo . ● Results in a build with 9 steps ● Pulls the Alpine linux image from Docker Hub ● Runs our commands ● Copies assets ● Exposes the necessary port to the host
  • 13. Building the image ● Step 1: FROM alpine:latest ● Step 2: RUN apk add --update py2-pip
  • 14. Building the image ● Step 3: RUN pip install --upgrade pip ● Step 4: COPY requirements.txt /usr/src/app/
  • 15. Building the image ● Step 5: RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt
  • 16. Building the image ● Step 6: COPY app.py /usr/src/app/ ● Step 7: COPY templates/index.html /usr/src/app/templates/ ● Step 8: EXPOSE 5000
  • 17. Building the image ● Step 9: CMD python /usr/src/app/app.py
  • 18. Running the container ● Mapping ports at runtime: ○ docker run -p 4000:5000 docker-demo ○ -p <host_port>:<container_port> ○ If no port is specified, a host port will be assigned randomly ● Naming the container for easier access and differentiation ○ docker run -p 4000:5000 --name demo docker-demo ○ --name <name> ○ If not specified, Docker will assign a random name to the container instance
  • 19. Cleaning up... ● List Docker containers: docker ps ● Stop a running container: docker stop <name_or_hash> ● Remove a stopped container: docker rm <name_or_hash> ● List images: docker images ● Remove an unused image: docker rmi <name_or_hash> A better way… ● docker run with --rm ● Automatically removes the container on exit
  • 20. Live Demo Risky business… Let’s try it out!
  • 21. Honorable Mentions ● Docker Compose ○ Defining a whole containerized workload in a single file definition ● Task Schedulers and Container Orchestration ○ Marathon, Amazon ECS, Rancher, Nomad
  • 22. Our use case for live streaming ● Deployed to Amazon Elastic Container Service ● Dynamically scales underlying resource pool based on utilization ● Individual transcoding containers independent for each stream ● Only use resources when the platform is in use ● Live stream capacity only limited by the maximum number of instances we can provision on AWS