SlideShare a Scribd company logo
@jbaruch #oraclecode
Docker Version –
Best Practices
@jbaruch #oraclecode
About me
»@jbaruch
»Developer Advocate @JFrog
»We might still have some t-shirts left!
@jbaruch #oraclecode
Poll Time!
@jbaruch #oraclecode
Poll Time!
»Heard about Docker
»Can do the tutorial
»PoCing, playing etc.
»Production, baby!
@jbaruch #oraclecode
@jbaruch #oraclecode
@jbaruch #oraclecode
@jbaruch #oraclecode
JFrog Artifactory + Docker
@jbaruch #oraclecode
»There are 2 hard problems in computer science:
cache invalidation,
naming things,
and off-by-1 errors.
@jbaruch #oraclecode
Naming Things
with Docker
@jbaruch #oraclecode
Who
Cares
About
Versions
Anyhow
?
@jbaruch #oraclecode
Why Do We Care about versions?
»Pipeline Automation/Orchestration
»Traceability/Communication
»Maintainability/Storage Management
@jbaruch #oraclecode
Those are old news,
we have been using versions for years
»Docker is different !!
»Versions are Tags
@jbaruch #oraclecode
Docker Manifest and Tags
ac-image:1.0 ac-image:1.0-beta ac-image:1.0-qa
Manifest
sha256:252564..
Manifest
sha256:462564..
ac-image:1.1
OS: SHA2
Framework: SHA2
Application: SHA2: 3
Layers
Application: SHA2: 4
Tags
Manife
st
@jbaruch #oraclecode
So let’s talk about tags in detail
»Mutable and Dynamic in nature
»Example: my-image:5.0
»And Latest is not latest
»Confusion !!
@jbaruch #oraclecode
my-image:5.0
OS layer
1.0
Framework
layer 2.0
Application
layer 2.0
OS layer
1.1
Framework
layer 2.1
Application
layer 2.1
Yesterday Today
@jbaruch #oraclecode
The case for `latest`
And other mutable tags
@jbaruch #oraclecode
Convenient promotion
@jbaruch #oraclecode
Automation:
Docker Image Promotion Process across
silos
@jbaruch #oraclecode
Promotion
ac-image:1.0-
dev
ac-image:1.0-qa
ac-image:1.0-
release
Manifest
sha256:252564..
OS: SHA2
Framework: SHA2
Application: SHA2: 3
L
a
y
e
r
s
T
a
g
s
@jbaruch #oraclecode
Pull, retag, push for every stage? It’s
nuts!!!
@jbaruch #oraclecode
We got you covered
@jbaruch #oraclecode
The case for immutable
tags
@jbaruch #oraclecode
Traceability!
»We always know what this image is
»Trace it back to CI
»Trace it back to source
@jbaruch #oraclecode
Traceability: Classic Approaches
»Version Names based On Git Hashes
»Version Names based on Jenkins Builds
»Version Names based on the packaged software
version number
»Version names with a unique date
(the build timestamp)
@jbaruch #oraclecode
So which one is
better?
@jbaruch #oraclecode
Static vs. Dynamic Tags
»Static Tags:
⋄Assigned at image CREATION
⋄Reflect metadata that traces the tag to its build and/or contents
»Dynamic Tags:
⋄Reflect an image you should use, the current known-good version
⋄Classic example is ubuntu:trusty
⋄Remember, ‘latest’ isn’t actually latest, just one tagged as such!
@jbaruch #oraclecode
Love and Hate the dynamic versions
Pros Cons
Versions express promotion state Consistency
No version – trash! Traceability
@jbaruch #oraclecode
Best Practices – Best of two worlds!
@jbaruch #oraclecode
Double Tag
»Push every image with a static tag
»Create a second, dynamic tag for the same
image as appropriate
⋄Just a like a sym-link
⋄Tag name is not traceable by itself, because the “dynamic”
tag may have moved since client pulled.
⋄Docker Inspect, Search, Find image for traceability
»Cleanup static tags based on some policy
@jbaruch #oraclecode
Static and Dynamic Tags
ac-image:1.0-
2017-04-01-
111
ac-image:latest1-
beta
ac-image:latest1
Manifest
sha256:252564..
Manifest
sha256:462564..
ac-image:1.0-
2017-04-03-
222
OS: SHA2
Framework: SHA2
Application: SHA2: 3
L
a
y
e
r
s Application: SHA2: 4
T
a
g
s
ac-
image:latest1
@jbaruch #oraclecode
The orphans
@jbaruch #oraclecode
Another problem!
»So, if we change tags during promotion, what
happens to not promoted images?
»They loose their version!!!
(WTF, what does that mean?)
@jbaruch #oraclecode
The unlucky ones
»In Java we call it SNAPSHOT-s.
»In Docker – images without versions.
»They are huge!
@jbaruch #oraclecode
@jbaruch #oraclecode
You don’t really have unlimited space
@jbaruch #oraclecode
How Docker Registries
Work
@jbaruch #oraclecode
Docker Distribution and DTR
»Checksum based storage
⋄Multiple tags with the same manifest does not use up additional disk
space
»Deleting a tag does NOT delete the layers from
storage
⋄Actual Delete based on SHA2 reference ONLY
⋄Tag is effectively deleted if you re-push with a same tag
⋄Old Manifest remains, and still referenceable by SHA2
@jbaruch #oraclecode
Deleting a tag does NOT delete
the layers from storage
ac-image:1.0 ac-image:1.0-beta ac-image:1.0-qa
Manifest
sha256:252564..
Manifest
sha256:462564..
ac-image:1.1
OS: SHA2
Framework: SHA2
Application: SHA2: 3
L
a
y
e
r
s Application: SHA2: 4
T
a
g
s
@jbaruch #oraclecode
Actual DELETE is based on SHA2
reference ONLY
ac-image:1.0 ac-image:1.0-qa
Manifest
sha256:252564..
Manifest
sha256:462564..
ac-image:1.1
OS: SHA2
Framework: SHA2
Application: SHA2: 3
L
a
y
e
r
s Application: SHA2: 4
T
a
g
s
Delete via
SHA2
@jbaruch #oraclecode
Docker GC
»Required to delete layers with no manifests
»Required to clear up disk space
»Stop the world
@jbaruch #oraclecode
Docker Distribution, Best Practice
»Delete layers without tags up front.
⋄HEAD Tag get SHA2 of manifest
⋄Delete SHA2
⋄After deleting reference, run GC to clean up
@jbaruch #oraclecode
Docker Distribution, Best Practice
»(Not OOB) To clean up a registry with manifests
that have no tag
⋄Command used to find these layers:
comm -23 <(find . -type f -name "link" | grep
"_manifests/revisions/sha256" | grep -v "/signatures/sha256/" | awk -F/
'{print $(NF-1)}' | sort) <(for f in $(find . -type f -name "link" | grep
"_manifests/tags/.*/current/link"); do cat ${f} | sed 's/^sha256://g';
echo; done | sort) | wc –l
@jbaruch #oraclecode
JFrog Artifactory
»We delete any layer that is not referenced by a
tag immediately
»We delete manifests that is not referenced by a
tag
»We have an API to copy/move a docker image or
change its tag without using the docker client to
pull/push a second time
»Configure the max number of tags per image
@jbaruch #oraclecode
Built-in cleanup
ac-image:1.0 ac-image:1.0-qa
Manifest
sha256:252564..
Manifest
sha256:462564..
ac-image:1.1
OS: SHA2
Framework: SHA2
Application: SHA2: 3
L
a
y
e
r
s Application: SHA2: 4
T
a
g
s
Delete via
SHA2
Manifest
sha256:462564..
ac-image:1.2
Application: SHA2: 5
Delete Tag
@jbaruch #oraclecode
Recap
»Dynamic versions are good for promotion
»Static versions are good for traceability
»Retagging should be done in the registry
»All unreferenced objects should be collected
@jbaruch #oraclecode
Q&A and Links
»@jbaruch
»jfrog.com/shownotes
»We’re hiring!

More Related Content

Similar to Best Practices for Managing Docker Versions as presented at JavaOne 2017 (20)

PPTX
Machine Learning and Logging for Monitoring Microservices
Daniel Berman
 
PDF
Play framework
Andrew Skiba
 
PPTX
Security Vulnerabilities in Mobile Applications (Kristaps Felzenbergs)
TestDevLab
 
PDF
Quarkus tips, tricks, and techniques
Red Hat Developers
 
PDF
Доклад Михаила Егорова на PHDays
ru_Parallels
 
PDF
Hacking Adobe Experience Manager sites
Mikhail Egorov
 
PDF
mjprof: Monadic approach for JVM profiling
Haim Yadid
 
PPTX
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps
Baruch Sadogursky
 
PDF
Neal Ford Emergent Design And Evolutionary Architecture
ThoughtWorks Studios
 
PDF
Neal Ford Emergent Design And Evolutionary Architecture
Thoughtworks
 
PDF
Drools, jBPM OptaPlanner presentation
Mark Proctor
 
PDF
Tracing the Breadcrumbs: Apache Spark Workload Diagnostics
Databricks
 
PDF
Freeing the cloud, one service at a time
Francois Marier
 
PPTX
Presentasi Adobe Camp 2012
Arie Prasetyo
 
PDF
Getting Git Right
Sven Peters
 
PDF
Why Django
Idan Gazit
 
PDF
[amigos] HTML5 and CSS3
Christopher Schmitt
 
PPT
Fotolog.Com.Mashraqi Scaling
Frank Cai
 
PDF
PTK 1.0 official presentation
DFLABS SRL
 
PDF
Stadnford University practical presentation.pdf
horiamommand
 
Machine Learning and Logging for Monitoring Microservices
Daniel Berman
 
Play framework
Andrew Skiba
 
Security Vulnerabilities in Mobile Applications (Kristaps Felzenbergs)
TestDevLab
 
Quarkus tips, tricks, and techniques
Red Hat Developers
 
Доклад Михаила Егорова на PHDays
ru_Parallels
 
Hacking Adobe Experience Manager sites
Mikhail Egorov
 
mjprof: Monadic approach for JVM profiling
Haim Yadid
 
[Webinar] The Frog And The Butler: CI Pipelines For Modern DevOps
Baruch Sadogursky
 
Neal Ford Emergent Design And Evolutionary Architecture
ThoughtWorks Studios
 
Neal Ford Emergent Design And Evolutionary Architecture
Thoughtworks
 
Drools, jBPM OptaPlanner presentation
Mark Proctor
 
Tracing the Breadcrumbs: Apache Spark Workload Diagnostics
Databricks
 
Freeing the cloud, one service at a time
Francois Marier
 
Presentasi Adobe Camp 2012
Arie Prasetyo
 
Getting Git Right
Sven Peters
 
Why Django
Idan Gazit
 
[amigos] HTML5 and CSS3
Christopher Schmitt
 
Fotolog.Com.Mashraqi Scaling
Frank Cai
 
PTK 1.0 official presentation
DFLABS SRL
 
Stadnford University practical presentation.pdf
horiamommand
 

More from Baruch Sadogursky (20)

PDF
DevOps Patterns & Antipatterns for Continuous Software Updates @ NADOG April ...
Baruch Sadogursky
 
PDF
DevOps Patterns & Antipatterns for Continuous Software Updates @ DevOps.com A...
Baruch Sadogursky
 
PDF
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code NY...
Baruch Sadogursky
 
PDF
Data driven devops as presented at QCon London 2018
Baruch Sadogursky
 
PDF
A Research Study Into DevOps Bottlenecks as presented at Oracle Code LA 2018
Baruch Sadogursky
 
PDF
Java Puzzlers NG S03 a DevNexus 2018
Baruch Sadogursky
 
PDF
Where the Helm are your binaries? as presented at Canada Kubernetes Meetups
Baruch Sadogursky
 
PDF
Data driven devops as presented at Codemash 2018
Baruch Sadogursky
 
PDF
A Research Study into DevOps Bottlenecks as presented at Codemash 2018
Baruch Sadogursky
 
PDF
Troubleshooting & Debugging Production Microservices in Kubernetes as present...
Baruch Sadogursky
 
PDF
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Devoxx 2017
Baruch Sadogursky
 
PPTX
Amazon Alexa Skills vs Google Home Actions, the Big Java VUI Faceoff as prese...
Baruch Sadogursky
 
PDF
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at DevOps Days Be...
Baruch Sadogursky
 
PDF
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...
Baruch Sadogursky
 
PDF
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at The Pittsburgh...
Baruch Sadogursky
 
PDF
Let’s Wing It: A Study in DevRel Strategy
Baruch Sadogursky
 
PDF
Log Driven First Class Customer Support at Scale
Baruch Sadogursky
 
PDF
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...
Baruch Sadogursky
 
PDF
Groovy Puzzlers S04: The Bytecode Bites Back at Gr8Conf US 2017
Baruch Sadogursky
 
PDF
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Gr8Conf 2017
Baruch Sadogursky
 
DevOps Patterns & Antipatterns for Continuous Software Updates @ NADOG April ...
Baruch Sadogursky
 
DevOps Patterns & Antipatterns for Continuous Software Updates @ DevOps.com A...
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Oracle Code NY...
Baruch Sadogursky
 
Data driven devops as presented at QCon London 2018
Baruch Sadogursky
 
A Research Study Into DevOps Bottlenecks as presented at Oracle Code LA 2018
Baruch Sadogursky
 
Java Puzzlers NG S03 a DevNexus 2018
Baruch Sadogursky
 
Where the Helm are your binaries? as presented at Canada Kubernetes Meetups
Baruch Sadogursky
 
Data driven devops as presented at Codemash 2018
Baruch Sadogursky
 
A Research Study into DevOps Bottlenecks as presented at Codemash 2018
Baruch Sadogursky
 
Troubleshooting & Debugging Production Microservices in Kubernetes as present...
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Devoxx 2017
Baruch Sadogursky
 
Amazon Alexa Skills vs Google Home Actions, the Big Java VUI Faceoff as prese...
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at DevOps Days Be...
Baruch Sadogursky
 
Java Puzzlers NG S02: Down the Rabbit Hole as it was presented at The Pittsbu...
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at The Pittsburgh...
Baruch Sadogursky
 
Let’s Wing It: A Study in DevRel Strategy
Baruch Sadogursky
 
Log Driven First Class Customer Support at Scale
Baruch Sadogursky
 
Patterns and antipatterns in Docker image lifecycle as was presented at DC Do...
Baruch Sadogursky
 
Groovy Puzzlers S04: The Bytecode Bites Back at Gr8Conf US 2017
Baruch Sadogursky
 
DevOps @Scale (Greek Tragedy in 3 Acts) as it was presented at Gr8Conf 2017
Baruch Sadogursky
 
Ad

Recently uploaded (20)

PPTX
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
PDF
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PDF
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
PDF
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
PDF
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
PDF
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
PDF
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
PDF
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Building Search Using OpenSearch: Limitations and Workarounds
Sease
 
HubSpot Main Hub: A Unified Growth Platform
Jaswinder Singh
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
SWEBOK Guide and Software Services Engineering Education
Hironori Washizaki
 
Achieving Consistent and Reliable AI Code Generation - Medusa AI
medusaaico
 
CIFDAQ Token Spotlight for 9th July 2025
CIFDAQ
 
Exolore The Essential AI Tools in 2025.pdf
Srinivasan M
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Fl Studio 24.2.2 Build 4597 Crack for Windows Free Download 2025
faizk77g
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
Timothy Rottach - Ramp up on AI Use Cases, from Vector Search to AI Agents wi...
AWS Chicago
 
Complete JavaScript Notes: From Basics to Advanced Concepts.pdf
haydendavispro
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
WooCommerce Workshop: Bring Your Laptop
Laura Hartwig
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Chris Elwell Woburn, MA - Passionate About IT Innovation
Chris Elwell Woburn, MA
 
Bitcoin for Millennials podcast with Bram, Power Laws of Bitcoin
Stephen Perrenod
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
Ad

Best Practices for Managing Docker Versions as presented at JavaOne 2017

Editor's Notes

  • #12: BOM (Bills of Material) – Software name. 5 items