SlideShare a Scribd company logo
1 of 36
Download to read offline
Michael Irwin - @mikesir87
Virginia Tech; Docker Captain
Containers
for Beginners
@mikesir87
Disclaimer: I cannot explain
sprankle pods either!
@mikesir87
Quick History of Shipping
Source: https://www.publicdomainpictures.net/en/view-image.php?image=275355 Source: https://en.wikipedia.org/wiki/Rail_freight_in_Great_Britain Source: https://pxhere.com/en/photo/553345
Software = Shipping?
@mikesir87
Shipping in Software
Source: https://www.usafe.af.mil/News/Photos/igphoto/2000887438/
@mikesir87
Either of these two scenarios
sound familiar to you?
@mikesir87
Welcome!
Glad to have
you on the
team!
Clone the repo,use the wiki forsetup instructions,and update the
docs as needed.Good luck!
@mikesir87
@mikesir87
Imagine if...
@mikesir87
Creating Images
• Best practice is to use a Dockerfile
• A text file that serves as a script to build an image
• Build using the docker build command
FROM node
WORKDIR /app
COPY package.json yarn.lock .
RUN yarn install
COPY src ./src
CMD ["node", "src/index.js"]
@mikesir87
Sharing Images
• Once built, the image is only available locally
• To share, push it to a registry using docker push
• Docker Hub is the default registry
• Docker EE includes the Docker Trusted Registry
• Many other third-party offerings available too
• Once shared, others can pull the image
Source: https://landscape.cncf.io
@mikesir87
Let’s build an image!
@mikesir87
What’s a container then?
• While a container looks like a VM, it isn’t!
• A container is just another process on the machine
• It uses namespaces and control groups (cgroups) to provide
isolation
• Namespaces include network, process, user, IPC, mount, and others
• To run a container, use the docker container run command
@mikesir87
@mikesir87
Containers vs VMs
Infrastructure
Host Operating System
Hypervisor
Guest OS
Bins/Libs
App 1
Guest OS
Bins/Libs
App 2
Guest OS
Bins/Libs
App 3
Infrastructure
Operating System
Bins/Libs
App 1
Bins/Libs
App 2
Bins/Libs
App 3
Docker
Daemon
@mikesir87
Image Layering
• Images are composed of layers of filesystem changes
• Each layer can add or remove from the previous layer
• Each layer’s filesystem changes are stored as a single tar file
• Each command in a Dockerfile creates a new layer
• Use the docker image history command to see the layers and the
command that was used to create each layer
@mikesir87
Layer contents
file1 file2 file3 file4
file2 file5
file1 file2 file3 file4 file5
Layer 1
Layer 2
Merged
• Layers are unioned together to make a full filesystem
• Each layer can add files as needed
• Files in “higher” layers replace the same file in “lower” layers
• The container uses the “merged” view
@mikesir87
What about deleted files?
● Deleted files are represented in a layer as a “whiteout” file
● Whiteout files are only used by the filesystem driver and not visible
in the merged filesystem
file1 file2 file3 file4
file2 file5
file1 file2 file3 file5
Layer 1
Layer 2
Merged
.wh.file4 Layer 3
@mikesir87
WARNING!
Be careful what you put into images.
Deleted files might not actually be
gone!
@mikesir87
Two Best Practices Incoming!
@mikesir87
Clean up as you go!
● Don’t wait until the end of the Dockerfile to “clean” up
● Chain RUN commands together to clean things as you go
FROM ubuntu
RUN apt-get update
RUN apt-get install -y python python-pip
RUN pip install awscli
RUN apt-get autoremove --purge -y python-pip
FROM ubuntu
RUN apt-get update && 
apt-get install -y python python-pip && 
pip install awscli && 
apt-get autoremove --purge -y python-pip && 
rm -rf /var/lib/apt/lists/*
Net change of image size from
512MB to 183MB (64% reduction)
@mikesir87
Keep images tight and focused
• Only install the deps/tools/packages that are necessary
• Use multi-stage builds to separate build-time and run-time
dependencies
FROM node AS build
WORKDIR /usr/src/app
COPY package.json yarn.lock .
RUN yarn install
COPY public ./public
COPY src ./src
RUN yarn build
FROM nginx:alpine
COPY nginx.conf /etc/nginx/nginx.conf
COPY --from=build /usr/src/app/build /usr/share/nginx/html
Sample multi-stage build for a React app
@mikesir87
How do you persist data?
@mikesir87
● Volumes provide the ability to persist/supply data
● Bind mount volumes
○ You choose where to persist the data
○ Example: -v $HOME/mysql-data:/var/lib/mysql
● Named volumes
○ Let Docker choose where to persist the data
○ Can use docker volume inspect to find actual location
○ Example: -v mysql-data:/var/lib/mysql
Volumes
@mikesir87
Show me these volumes!
@mikesir87
@mikesir87
Docker Compose
• Makes defining and running multi-container apps super easy
• Uses a YAML file for configuration (docker-compose.yml)
• Often included in project source repo at the root of the project
• With a single command, start all containers/services for an app
• Tool is bundled with Docker Desktop
@mikesir87
Docker Networking
• Think of networking in terms of communication boundaries/isolation
• If two containers are on the same network, they can talk to each other
• Docker runs its own DNS resolver on each network
• Allows it to resolve IP addresses of other containers using “aliases”
API1
Database
Reverse Proxy
React App
API2
Cache
@mikesir87
Quick compose demo!
@mikesir87
Container Orchestration
• Orchestration provides the ability to manage the running of
container workloads, often over a fleet of machines
• You define the expected state (the desired state)
• The system then tries to make actual state reflect expected state
@mikesir87
Actors in Orchestration
• Every orchestrator has the concept of two types
of nodes
• Managers
• Serve as the brains of the cluster
• Maintain state and schedule work
• Sometimes called masters
• Worker nodes
• Perform the actual work, as instructed by a manager
• Sometimes called agents or nodes
@mikesir87
Various Orchestrators
• Docker Swarm
• Shipped with the Docker engine
• Very user friendly and easy to get up and running
• Satisfies most needs, though not all; built to be extensible, but takes some work
• Kubernetes
• Spun out of work done within Google and contributed to CNCF
• Think of it more as a toolkit - so not as easy to get up and running
• Very configurable and extensible
• Amazon ECS
• Made by Amazon Web Services and provided for free
• Provides deep integration with AWS resources (IAM, ALBs, Auto-scaling, etc.)
@mikesir87
Quick Swarm Demo!
@mikesir87
• Containers/images are here to standardize application packaging
• No longer require host configuration
• Docker Compose builds on the abstraction to make multi-service apps easier
• Container orchestration builds on this idea
• Be mindful of how you build your images and what you include
• Volumes allow data to be persisted longer than the container
• Networking serves provides communication paths/isolation
Recap
@mikesir87
WARNING!
Containers are NOT a silver bullet
that will fix your company culture
Thank you!
Rate the session!
Keep in touch!
@mikesir87; mikesir87@vt.edu

More Related Content

What's hot

Containers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes IstioContainers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes IstioAraf Karsh Hamid
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesSlideTeam
 
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...SlideTeam
 
Event Driven Microservices architecture
Event Driven Microservices architectureEvent Driven Microservices architecture
Event Driven Microservices architectureNikhilBarthwal4
 
Security Process in DevSecOps
Security Process in DevSecOpsSecurity Process in DevSecOps
Security Process in DevSecOpsOpsta
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and HowSneha Inguva
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing MicroservicesNagarro
 
DevOps introduction
DevOps introductionDevOps introduction
DevOps introductionSridhara T V
 
Docker Advanced registry usage
Docker Advanced registry usageDocker Advanced registry usage
Docker Advanced registry usageDocker, Inc.
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Herofazalraja
 
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 BarcelonaAWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 BarcelonaAmazon Web Services
 
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...Simplilearn
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with DockerRavindu Fernando
 
Docker introduction & benefits
Docker introduction & benefitsDocker introduction & benefits
Docker introduction & benefitsAmit Manwade
 
Practical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdfPractical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdfAhmed Misbah
 
Service Mesh - Observability
Service Mesh - ObservabilityService Mesh - Observability
Service Mesh - ObservabilityAraf Karsh Hamid
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)Gourav Varma
 
Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)WSO2
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services ArchitectureAraf Karsh Hamid
 

What's hot (20)

Containers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes IstioContainers Docker Kind Kubernetes Istio
Containers Docker Kind Kubernetes Istio
 
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation SlidesKubernetes Concepts And Architecture Powerpoint Presentation Slides
Kubernetes Concepts And Architecture Powerpoint Presentation Slides
 
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...
An Architectural Deep Dive With Kubernetes And Containers Powerpoint Presenta...
 
Event Driven Microservices architecture
Event Driven Microservices architectureEvent Driven Microservices architecture
Event Driven Microservices architecture
 
Security Process in DevSecOps
Security Process in DevSecOpsSecurity Process in DevSecOps
Security Process in DevSecOps
 
Containers: The What, Why, and How
Containers: The What, Why, and HowContainers: The What, Why, and How
Containers: The What, Why, and How
 
Testing Microservices
Testing MicroservicesTesting Microservices
Testing Microservices
 
DevOps introduction
DevOps introductionDevOps introduction
DevOps introduction
 
Docker Advanced registry usage
Docker Advanced registry usageDocker Advanced registry usage
Docker Advanced registry usage
 
Docker: From Zero to Hero
Docker: From Zero to HeroDocker: From Zero to Hero
Docker: From Zero to Hero
 
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 BarcelonaAWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
AWS App Mesh (Service Mesh Magic)- AWS Container Day 2019 Barcelona
 
Scalable web architecture
Scalable web architectureScalable web architecture
Scalable web architecture
 
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...
What Is Docker? | What Is Docker And How It Works? | Docker Tutorial For Begi...
 
Getting started with Docker
Getting started with DockerGetting started with Docker
Getting started with Docker
 
Docker introduction & benefits
Docker introduction & benefitsDocker introduction & benefits
Docker introduction & benefits
 
Practical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdfPractical Microservice Architecture (edition 2022).pdf
Practical Microservice Architecture (edition 2022).pdf
 
Service Mesh - Observability
Service Mesh - ObservabilityService Mesh - Observability
Service Mesh - Observability
 
Docker introduction (1)
Docker introduction (1)Docker introduction (1)
Docker introduction (1)
 
Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)Event-Driven Architecture (EDA)
Event-Driven Architecture (EDA)
 
Micro services Architecture
Micro services ArchitectureMicro services Architecture
Micro services Architecture
 

Similar to DCSF19 Containers for Beginners

eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...Gaetano Giunta
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with DockerGeeta Vinnakota
 
Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...All Things Open
 
Securing Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad MeetupSecuring Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad MeetupKumar Ashwin
 
Securing Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad MeetupSecuring Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad MeetupKumar Ashwin
 
Virtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management servicesVirtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management servicesabhishek chawla
 
Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataInfluxData
 
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzureDocker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzurePatrick Chanezon
 
Docker and SDL Web/Tridion - SDL UK User Group April 2017
Docker and SDL Web/Tridion - SDL UK User Group April 2017Docker and SDL Web/Tridion - SDL UK User Group April 2017
Docker and SDL Web/Tridion - SDL UK User Group April 2017rsleggett
 
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Patrick Chanezon
 
Docker and Microservice
Docker and MicroserviceDocker and Microservice
Docker and MicroserviceSamuel Chow
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetesDongwon Kim
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationGiacomo Vacca
 
Introduction to Docker Containers - Docker Captain
Introduction to Docker Containers - Docker CaptainIntroduction to Docker Containers - Docker Captain
Introduction to Docker Containers - Docker CaptainAjeet Singh Raina
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101Naukri.com
 

Similar to DCSF19 Containers for Beginners (20)

eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 
Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...Containers in depth – Understanding how containers work to better work with c...
Containers in depth – Understanding how containers work to better work with c...
 
Securing Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad MeetupSecuring Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad Meetup
 
Securing Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad MeetupSecuring Containers From Day One | null Ahmedabad Meetup
Securing Containers From Day One | null Ahmedabad Meetup
 
Virtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management servicesVirtualization, Containers, Docker and scalable container management services
Virtualization, Containers, Docker and scalable container management services
 
Introduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxDataIntroduction to Docker and Monitoring with InfluxData
Introduction to Docker and Monitoring with InfluxData
 
JOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in ProductionJOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in Production
 
Dockerfile
Dockerfile Dockerfile
Dockerfile
 
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 Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on AzureDocker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
Docker Seattle Meetup April 2015 - The Docker Orchestration Ecosystem on Azure
 
Docker and SDL Web/Tridion - SDL UK User Group April 2017
Docker and SDL Web/Tridion - SDL UK User Group April 2017Docker and SDL Web/Tridion - SDL UK User Group April 2017
Docker and SDL Web/Tridion - SDL UK User Group April 2017
 
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
Docker New York Meetup May 2015 - The Docker Orchestration Ecosystem on Azure
 
Docker and Microservice
Docker and MicroserviceDocker and Microservice
Docker and Microservice
 
Docker and kubernetes
Docker and kubernetesDocker and kubernetes
Docker and kubernetes
 
Docker and Puppet for Continuous Integration
Docker and Puppet for Continuous IntegrationDocker and Puppet for Continuous Integration
Docker and Puppet for Continuous Integration
 
Introduction to Docker Containers - Docker Captain
Introduction to Docker Containers - Docker CaptainIntroduction to Docker Containers - Docker Captain
Introduction to Docker Containers - Docker Captain
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101[@NaukriEngineering] Docker 101
[@NaukriEngineering] Docker 101
 

More from Docker, Inc.

Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Docker, Inc.
 
How to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildHow to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildDocker, Inc.
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSDocker, Inc.
 
Securing Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXSecuring Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXDocker, Inc.
 
How To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeHow To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeDocker, Inc.
 
Distributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDistributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDocker, Inc.
 
The First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubThe First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubDocker, Inc.
 
Monitoring in a Microservices World
Monitoring in a Microservices WorldMonitoring in a Microservices World
Monitoring in a Microservices WorldDocker, Inc.
 
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...Docker, Inc.
 
Predicting Space Weather with Docker
Predicting Space Weather with DockerPredicting Space Weather with Docker
Predicting Space Weather with DockerDocker, Inc.
 
Become a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeBecome a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeDocker, Inc.
 
How to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryHow to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryDocker, Inc.
 
Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Docker, Inc.
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog ScaleDocker, Inc.
 
Labels, Labels, Labels
Labels, Labels, Labels Labels, Labels, Labels
Labels, Labels, Labels Docker, Inc.
 
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelUsing Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelDocker, Inc.
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSDocker, Inc.
 
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...Docker, Inc.
 
Developing with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDeveloping with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDocker, Inc.
 

More from Docker, Inc. (20)

Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience Containerize Your Game Server for the Best Multiplayer Experience
Containerize Your Game Server for the Best Multiplayer Experience
 
How to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker BuildHow to Improve Your Image Builds Using Advance Docker Build
How to Improve Your Image Builds Using Advance Docker Build
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
 
Securing Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINXSecuring Your Containerized Applications with NGINX
Securing Your Containerized Applications with NGINX
 
How To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and ComposeHow To Build and Run Node Apps with Docker and Compose
How To Build and Run Node Apps with Docker and Compose
 
Hands-on Helm
Hands-on Helm Hands-on Helm
Hands-on Helm
 
Distributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at SalesforceDistributed Deep Learning with Docker at Salesforce
Distributed Deep Learning with Docker at Salesforce
 
The First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker HubThe First 10M Pulls: Building The Official Curl Image for Docker Hub
The First 10M Pulls: Building The Official Curl Image for Docker Hub
 
Monitoring in a Microservices World
Monitoring in a Microservices WorldMonitoring in a Microservices World
Monitoring in a Microservices World
 
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
COVID-19 in Italy: How Docker is Helping the Biggest Italian IT Company Conti...
 
Predicting Space Weather with Docker
Predicting Space Weather with DockerPredicting Space Weather with Docker
Predicting Space Weather with Docker
 
Become a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio CodeBecome a Docker Power User With Microsoft Visual Studio Code
Become a Docker Power User With Microsoft Visual Studio Code
 
How to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container RegistryHow to Use Mirroring and Caching to Optimize your Container Registry
How to Use Mirroring and Caching to Optimize your Container Registry
 
Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!Monolithic to Microservices + Docker = SDLC on Steroids!
Monolithic to Microservices + Docker = SDLC on Steroids!
 
Kubernetes at Datadog Scale
Kubernetes at Datadog ScaleKubernetes at Datadog Scale
Kubernetes at Datadog Scale
 
Labels, Labels, Labels
Labels, Labels, Labels Labels, Labels, Labels
Labels, Labels, Labels
 
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment ModelUsing Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
Using Docker Hub at Scale to Support Micro Focus' Delivery and Deployment Model
 
Build & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWSBuild & Deploy Multi-Container Applications to AWS
Build & Deploy Multi-Container Applications to AWS
 
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
From Fortran on the Desktop to Kubernetes in the Cloud: A Windows Migration S...
 
Developing with Docker for the Arm Architecture
Developing with Docker for the Arm ArchitectureDeveloping with Docker for the Arm Architecture
Developing with Docker for the Arm Architecture
 

Recently uploaded

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKJago de Vreede
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 

Recently uploaded (20)

Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
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
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
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
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
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
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

DCSF19 Containers for Beginners

  • 1. Michael Irwin - @mikesir87 Virginia Tech; Docker Captain Containers for Beginners
  • 2. @mikesir87 Disclaimer: I cannot explain sprankle pods either!
  • 3. @mikesir87 Quick History of Shipping Source: https://www.publicdomainpictures.net/en/view-image.php?image=275355 Source: https://en.wikipedia.org/wiki/Rail_freight_in_Great_Britain Source: https://pxhere.com/en/photo/553345
  • 5. @mikesir87 Shipping in Software Source: https://www.usafe.af.mil/News/Photos/igphoto/2000887438/
  • 6. @mikesir87 Either of these two scenarios sound familiar to you?
  • 7. @mikesir87 Welcome! Glad to have you on the team! Clone the repo,use the wiki forsetup instructions,and update the docs as needed.Good luck!
  • 10. @mikesir87 Creating Images • Best practice is to use a Dockerfile • A text file that serves as a script to build an image • Build using the docker build command FROM node WORKDIR /app COPY package.json yarn.lock . RUN yarn install COPY src ./src CMD ["node", "src/index.js"]
  • 11. @mikesir87 Sharing Images • Once built, the image is only available locally • To share, push it to a registry using docker push • Docker Hub is the default registry • Docker EE includes the Docker Trusted Registry • Many other third-party offerings available too • Once shared, others can pull the image Source: https://landscape.cncf.io
  • 13. @mikesir87 What’s a container then? • While a container looks like a VM, it isn’t! • A container is just another process on the machine • It uses namespaces and control groups (cgroups) to provide isolation • Namespaces include network, process, user, IPC, mount, and others • To run a container, use the docker container run command
  • 15. @mikesir87 Containers vs VMs Infrastructure Host Operating System Hypervisor Guest OS Bins/Libs App 1 Guest OS Bins/Libs App 2 Guest OS Bins/Libs App 3 Infrastructure Operating System Bins/Libs App 1 Bins/Libs App 2 Bins/Libs App 3 Docker Daemon
  • 16. @mikesir87 Image Layering • Images are composed of layers of filesystem changes • Each layer can add or remove from the previous layer • Each layer’s filesystem changes are stored as a single tar file • Each command in a Dockerfile creates a new layer • Use the docker image history command to see the layers and the command that was used to create each layer
  • 17. @mikesir87 Layer contents file1 file2 file3 file4 file2 file5 file1 file2 file3 file4 file5 Layer 1 Layer 2 Merged • Layers are unioned together to make a full filesystem • Each layer can add files as needed • Files in “higher” layers replace the same file in “lower” layers • The container uses the “merged” view
  • 18. @mikesir87 What about deleted files? ● Deleted files are represented in a layer as a “whiteout” file ● Whiteout files are only used by the filesystem driver and not visible in the merged filesystem file1 file2 file3 file4 file2 file5 file1 file2 file3 file5 Layer 1 Layer 2 Merged .wh.file4 Layer 3
  • 19. @mikesir87 WARNING! Be careful what you put into images. Deleted files might not actually be gone!
  • 21. @mikesir87 Clean up as you go! ● Don’t wait until the end of the Dockerfile to “clean” up ● Chain RUN commands together to clean things as you go FROM ubuntu RUN apt-get update RUN apt-get install -y python python-pip RUN pip install awscli RUN apt-get autoremove --purge -y python-pip FROM ubuntu RUN apt-get update && apt-get install -y python python-pip && pip install awscli && apt-get autoremove --purge -y python-pip && rm -rf /var/lib/apt/lists/* Net change of image size from 512MB to 183MB (64% reduction)
  • 22. @mikesir87 Keep images tight and focused • Only install the deps/tools/packages that are necessary • Use multi-stage builds to separate build-time and run-time dependencies FROM node AS build WORKDIR /usr/src/app COPY package.json yarn.lock . RUN yarn install COPY public ./public COPY src ./src RUN yarn build FROM nginx:alpine COPY nginx.conf /etc/nginx/nginx.conf COPY --from=build /usr/src/app/build /usr/share/nginx/html Sample multi-stage build for a React app
  • 23. @mikesir87 How do you persist data?
  • 24. @mikesir87 ● Volumes provide the ability to persist/supply data ● Bind mount volumes ○ You choose where to persist the data ○ Example: -v $HOME/mysql-data:/var/lib/mysql ● Named volumes ○ Let Docker choose where to persist the data ○ Can use docker volume inspect to find actual location ○ Example: -v mysql-data:/var/lib/mysql Volumes
  • 27. @mikesir87 Docker Compose • Makes defining and running multi-container apps super easy • Uses a YAML file for configuration (docker-compose.yml) • Often included in project source repo at the root of the project • With a single command, start all containers/services for an app • Tool is bundled with Docker Desktop
  • 28. @mikesir87 Docker Networking • Think of networking in terms of communication boundaries/isolation • If two containers are on the same network, they can talk to each other • Docker runs its own DNS resolver on each network • Allows it to resolve IP addresses of other containers using “aliases” API1 Database Reverse Proxy React App API2 Cache
  • 30. @mikesir87 Container Orchestration • Orchestration provides the ability to manage the running of container workloads, often over a fleet of machines • You define the expected state (the desired state) • The system then tries to make actual state reflect expected state
  • 31. @mikesir87 Actors in Orchestration • Every orchestrator has the concept of two types of nodes • Managers • Serve as the brains of the cluster • Maintain state and schedule work • Sometimes called masters • Worker nodes • Perform the actual work, as instructed by a manager • Sometimes called agents or nodes
  • 32. @mikesir87 Various Orchestrators • Docker Swarm • Shipped with the Docker engine • Very user friendly and easy to get up and running • Satisfies most needs, though not all; built to be extensible, but takes some work • Kubernetes • Spun out of work done within Google and contributed to CNCF • Think of it more as a toolkit - so not as easy to get up and running • Very configurable and extensible • Amazon ECS • Made by Amazon Web Services and provided for free • Provides deep integration with AWS resources (IAM, ALBs, Auto-scaling, etc.)
  • 34. @mikesir87 • Containers/images are here to standardize application packaging • No longer require host configuration • Docker Compose builds on the abstraction to make multi-service apps easier • Container orchestration builds on this idea • Be mindful of how you build your images and what you include • Volumes allow data to be persisted longer than the container • Networking serves provides communication paths/isolation Recap
  • 35. @mikesir87 WARNING! Containers are NOT a silver bullet that will fix your company culture
  • 36. Thank you! Rate the session! Keep in touch! @mikesir87; mikesir87@vt.edu