SlideShare uma empresa Scribd logo
1 de 35
Baixar para ler offline
Caching
Caching Demos
Caching Limitations
Caching Other Registries
Caching Gitlab Demo
Mirroring
Manual Mirroring
Summary
Agenda
@sudo_bmitch1 / 35
        
How to Use Mirroring and
Caching to Optimize Your
Image Registry
Brandon Mitchell
Twitter: @sudo_bmitch
GitHub: sudo-bmitch
2 / 35
Ephemeral Build Server?
@sudo_bmitch3 / 35
Cluster Pulling Remote Images?
@sudo_bmitch4 / 35
Worry About Upstream Image Changes?
@sudo_bmitch5 / 35
Build and Deploy Infrastructure Tolerant of
Upstream Outages?
@sudo_bmitch6 / 35
Production Resilience
@sudo_bmitch7 / 35
Build Infrastructure
@sudo_bmitch8 / 35
Build Outage
@sudo_bmitch9 / 35
Build Resilience
@sudo_bmitch10 / 35
Faster Builds and Less Bandwidth
@sudo_bmitch11 / 35
Caching
@sudo_bmitch12 / 35
Caching is the Easy Button
https://commons.wikimedia.org/wiki/File:Easy_button.JPG
@sudo_bmitch13 / 35
Cache Architecture
@sudo_bmitch14 / 35
Cache Implementation
Either the dockerd CLI:
dockerd --registry-mirror <cache-url>
Or /etc/docker/daemon.json
{ "registry-mirrors": [ "<cache-url>" ] }
Plus a registry:
docker run -e REGISTRY_PROXY_REMOTEURL=<upstream-url> registry:2
@sudo_bmitch15 / 35
@sudo_bmitch
00:00
16 / 35
@sudo_bmitch
00:00
17 / 35
@sudo_bmitch
00:00
18 / 35
@sudo_bmitch
00:00
19 / 35
@sudo_bmitch
00:00
20 / 35
So What's the Catch?
@sudo_bmitch21 / 35
Cache Limitations
The "registry-mirror" setting only applies to Docker Hub
Only caches pulls not pushes
Pulls still check the image manifest on Hub
Credentials are in the cache server
Docker implementation only supports one authentication method
@sudo_bmitch22 / 35
Options to Cache Other Registries
Con gure a squid HTTP caching proxy
Pull directly from the cache
Use DNS and TLS certs to send pulls to the proxy
@sudo_bmitch23 / 35
@sudo_bmitch
00:00
24 / 35
I Want More
@sudo_bmitch25 / 35
Mirroring
@sudo_bmitch26 / 35
Mirror Architecture
@sudo_bmitch27 / 35
Running a Registry
Docker image
docker container run -p 5000:5000 registry:2
Harbor
Many Artifact Repositories
@sudo_bmitch28 / 35
Manually Mirroring
docker image pull ${image}
docker image tag ${image} local-mirror:5000/${image}
docker image push local-mirror:5000/${image}
@sudo_bmitch29 / 35
Manual Mirror Script
docker image pull "$localimg"
docker image pull "$remoteimg"
remoteid=$(docker image inspect "$remoteimg" --format '{.Id}')
localid=$(docker image inspect "$localimg" --format '{.Id}')
if [ "$remoteid" != "$localid" ]; then
docker image tag "$localimg" "$localimg.$datestamp"
docker image tag "$remoteimg" "$localimg"
docker image push "$localimg.$datestamp"
docker image push "$localimg"
fi
@sudo_bmitch30 / 35
Why All the Complication?
@sudo_bmitch31 / 35
Advantages of Manually Mirroring
Over Automatically Syncing Repos:
Changes to images happen on your schedule
Backout option exists with breaking changes
Over Pull Through Cache
Those reasons plus...
Pushing locally built images to the registry
Upstream outage doesn't stop local builds/deploys
@sudo_bmitch32 / 35
Risks of Manually Mirroring
Images go stale if you do not automate the script
Adding new images is an added process
Recovering from a mirror outage requires populating images
FROM line in images needs to point to mirror
ARG REGISTRY=docker.io
FROM ${REGISTRY}/alpine:3.9
...
docker build --build-arg REGISTRY=local-mirror:5000 .
@sudo_bmitch33 / 35
Summary
Both
Saves bandwidth
Faster builds
Pull Through Cache
Easy to create
Little maintenance
Managed Mirror
Control changes
Tolerate upstream outages
@sudo_bmitch34 / 35
Brandon Mitchell
Twitter: @sudo_bmitch
GitHub: sudo-bmitch
Thank You
github.com/sudo-bmitch/presentations
35 / 35

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Optimizing Docker Images
Optimizing Docker ImagesOptimizing Docker Images
Optimizing Docker Images
 
Agile Principles, Agile People
Agile Principles, Agile PeopleAgile Principles, Agile People
Agile Principles, Agile People
 
使用Azure Boards實現Scrum.pdf
使用Azure Boards實現Scrum.pdf使用Azure Boards實現Scrum.pdf
使用Azure Boards實現Scrum.pdf
 
DCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best PracticesDCEU 18: Dockerfile Best Practices
DCEU 18: Dockerfile Best Practices
 
.NET Day - Continuous Deployment Showdown: Traditional CI/CD vs. GitOps
.NET Day - Continuous Deployment Showdown: Traditional CI/CD vs. GitOps.NET Day - Continuous Deployment Showdown: Traditional CI/CD vs. GitOps
.NET Day - Continuous Deployment Showdown: Traditional CI/CD vs. GitOps
 
Mini exercises series game 2 - gaming the manifesto
Mini exercises series game 2 - gaming the manifestoMini exercises series game 2 - gaming the manifesto
Mini exercises series game 2 - gaming the manifesto
 
DevOps a pratical approach
DevOps a pratical approachDevOps a pratical approach
DevOps a pratical approach
 
Creating Robust, Resilient & Antifragile Organizations (using Kanban)
Creating Robust, Resilient & Antifragile Organizations (using Kanban)Creating Robust, Resilient & Antifragile Organizations (using Kanban)
Creating Robust, Resilient & Antifragile Organizations (using Kanban)
 
Lean Portfolio Management
Lean Portfolio ManagementLean Portfolio Management
Lean Portfolio Management
 
LEGO® Serious Play® — For Managers
LEGO® Serious Play® — For ManagersLEGO® Serious Play® — For Managers
LEGO® Serious Play® — For Managers
 
OPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
OPENSHIFT CONTAINER PLATFORM CI/CD Build & DeployOPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
OPENSHIFT CONTAINER PLATFORM CI/CD Build & Deploy
 
提到 DevOps 到底在談些什麼玩意兒?
提到 DevOps 到底在談些什麼玩意兒?提到 DevOps 到底在談些什麼玩意兒?
提到 DevOps 到底在談些什麼玩意兒?
 
Scaling Agile With SAFe (Scaled Agile Framework)
Scaling Agile With SAFe (Scaled Agile Framework)Scaling Agile With SAFe (Scaled Agile Framework)
Scaling Agile With SAFe (Scaled Agile Framework)
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Docker praktyczne podstawy
Docker  praktyczne podstawyDocker  praktyczne podstawy
Docker praktyczne podstawy
 
DevOps & SRE at Google Scale
DevOps & SRE at Google ScaleDevOps & SRE at Google Scale
DevOps & SRE at Google Scale
 
CI/CD Best Practices for Your DevOps Journey
CI/CD Best  Practices for Your DevOps JourneyCI/CD Best  Practices for Your DevOps Journey
CI/CD Best Practices for Your DevOps Journey
 
シスコ装置を使い倒す!組込み機能による可視化からセキュリティ強化
シスコ装置を使い倒す!組込み機能による可視化からセキュリティ強化シスコ装置を使い倒す!組込み機能による可視化からセキュリティ強化
シスコ装置を使い倒す!組込み機能による可視化からセキュリティ強化
 
Team Topologies - how and why to design your teams - AllDayDevOps 2017
Team Topologies - how and why to design your teams - AllDayDevOps 2017Team Topologies - how and why to design your teams - AllDayDevOps 2017
Team Topologies - how and why to design your teams - AllDayDevOps 2017
 
Kubernetes Architecture and Introduction
Kubernetes Architecture and IntroductionKubernetes Architecture and Introduction
Kubernetes Architecture and Introduction
 

Semelhante a How to Use Mirroring and Caching to Optimize your Container Registry

Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Docker and Your Path to a Better Staging Environment - webinar by Gil TayarDocker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Applitools
 
20131015_demo_oshk
20131015_demo_oshk20131015_demo_oshk
20131015_demo_oshk
Jeff Yang
 
- Codemotion Rome 2015
- Codemotion Rome 2015- Codemotion Rome 2015
- Codemotion Rome 2015
Codemotion
 

Semelhante a How to Use Mirroring and Caching to Optimize your Container Registry (20)

DCSF19 Tips and Tricks of the Docker Captains
DCSF19 Tips and Tricks of the Docker Captains  DCSF19 Tips and Tricks of the Docker Captains
DCSF19 Tips and Tricks of the Docker Captains
 
Optimizing Your CI Pipelines
Optimizing Your CI PipelinesOptimizing Your CI Pipelines
Optimizing Your CI Pipelines
 
Learning Docker with Thomas
Learning Docker with ThomasLearning Docker with Thomas
Learning Docker with Thomas
 
Into to Docker (Central PA Java User Group - 8/14/2017)
Into to Docker (Central PA Java User Group - 8/14/2017)Into to Docker (Central PA Java User Group - 8/14/2017)
Into to Docker (Central PA Java User Group - 8/14/2017)
 
5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CI5 Things I Wish I Knew About Gitlab CI
5 Things I Wish I Knew About Gitlab CI
 
Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Docker and Your Path to a Better Staging Environment - webinar by Gil TayarDocker and Your Path to a Better Staging Environment - webinar by Gil Tayar
Docker and Your Path to a Better Staging Environment - webinar by Gil Tayar
 
20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engver20150317 firefox os_studymtg_engver
20150317 firefox os_studymtg_engver
 
Cloud RPI4 tomcat ARM64
Cloud RPI4 tomcat ARM64Cloud RPI4 tomcat ARM64
Cloud RPI4 tomcat ARM64
 
Git submodule
Git submoduleGit submodule
Git submodule
 
20131015_demo_oshk
20131015_demo_oshk20131015_demo_oshk
20131015_demo_oshk
 
Securité des container
Securité des containerSecurité des container
Securité des container
 
vBACD - Introduction to Opscode Chef - 2/29
vBACD - Introduction to Opscode Chef - 2/29vBACD - Introduction to Opscode Chef - 2/29
vBACD - Introduction to Opscode Chef - 2/29
 
GitLab on OpenShift
GitLab on OpenShiftGitLab on OpenShift
GitLab on OpenShift
 
Serverless Container with Source2Image
Serverless Container with Source2ImageServerless Container with Source2Image
Serverless Container with Source2Image
 
Serverless containers … with source-to-image
Serverless containers  … with source-to-imageServerless containers  … with source-to-image
Serverless containers … with source-to-image
 
GIT training - advanced for software projects
GIT training - advanced for software projectsGIT training - advanced for software projects
GIT training - advanced for software projects
 
The Container Security Checklist
The Container Security Checklist The Container Security Checklist
The Container Security Checklist
 
Lights, Camera, Docker: Streaming Video at DramaFever
Lights, Camera, Docker: Streaming Video at DramaFeverLights, Camera, Docker: Streaming Video at DramaFever
Lights, Camera, Docker: Streaming Video at DramaFever
 
- Codemotion Rome 2015
- Codemotion Rome 2015- Codemotion Rome 2015
- Codemotion Rome 2015
 
Reusing your existing software on Android
Reusing your existing software on AndroidReusing your existing software on Android
Reusing your existing software on Android
 

Mais de Docker, 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 AWS
Docker, 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 AWS
Docker, Inc.
 

Mais de 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
 
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
 
Sharing is Caring: How to Begin Speaking at Conferences
Sharing is Caring: How to Begin Speaking at ConferencesSharing is Caring: How to Begin Speaking at Conferences
Sharing is Caring: How to Begin Speaking at Conferences
 

Último

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
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
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
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
 
"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 ...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

How to Use Mirroring and Caching to Optimize your Container Registry