SlideShare a Scribd company logo
Using and abusing
container metadata
Liz Rice
@lizrice | @microscaling
speakerdeck.com/lizrice/using-and-abusing
-container-metadata
Agenda
● Container images and layers
● Container metadata and labels
● Metadata inheritance
● Metadata automation
Frisbee whizzing
through the air
above our heads
over the sand
into the water
onto the waves
out to sea.
You cried a lot that day.
Frisbee was a lovely dog.
Brian Bilston
Image: Lewis Clarke
Containers
Image: Tyler Allen
Container
Images
1. Container images
server
Host OS
bins / libs
App A
bins / libs
App B
image
Dockerfile image
docker build
Let’s make one
Create a new directory
$ mkdir tiad # or whatever you like
$ cd tiad
Create a file called greeting, something like this
Hello TIAD
Create a file called Dockerfile
FROM alpine:latest
MAINTAINER <your@email.address>
COPY greeting greeting
CMD echo `cat greeting`
Reverse
quotes
You’ll need a Docker Hub namespace
- Your Docker Hub name
- Or maybe an organization
Build the container
$ docker build -t <namespace>/tiad .
Run it
$ docker run <namespace>/tiad
Push it to Docker Hub
- You’ll need your Docker Hub repo name
$ docker push <namespace>/tiad
- You might need to log in first
$ docker login
Look at the image information
$ docker inspect <namespace>/tiad
...
"Author": "liz@lizrice.com",
...
"Cmd": [
"/bin/sh",
"-c",
"echo `cat greeting`"
],
...
"Layers": [
"sha256:9007f5987db353ec398a223bc5a135c5a9601798b...
"sha256:182229f64cf81b7c99d6009c85764eb359f636f8df2...
...
Look up your image on microbadger.com
Dockerfile image
docker build
Dockerfile
FROM
MAINTAINER
COPY
CMD
Image
File system layer
Metadata
Metadata
File system layer
2. Container metadata
- Tagging
- Labels
TIAD 2016 : Using and abusing container metadata
Tagging
Distinguish between different versions of the same
image
Edit the greeting file
Build a new version of the container, with a new tag
$ docker build -t <namespace>/tiad:new .
Run it
$ docker run <namespace>/tiad:new
Push it
$ docker push <namespace>/tiad:new
Find the Webhook for your image on MicroBadger
POST to it to trigger re-inspection
$ curl -X POST
https://hooks.microbadger.com/<your webhook>
Look at it on Docker Hub (hub.docker.com) and
MicroBadger
- See both tagged versions (latest & new)
- Which is most recent?
TIAD 2016 : Using and abusing container metadata
Labelling
Add arbitrary metadata to your image
git ref
usage
contact
vendor
Image
git ref
usage
contact
vendor
Image
Alarm system
automatically
connected to
contactReproduce
problem with
precise
codebase
Filter
deployed
images from
vendor
Standard semantics for container labels
label-schema.org
Add labels in your Dockerfile
FROM alpine:latest
MAINTAINER <your@email.address>
COPY greeting greeting
CMD echo `cat greeting`
LABEL org.label-schema.name=“TIAD test” 
org.label-schema.description=“Whatever
you like”
Build a new version of the container with another tag
$ docker build -t <namespace>/tiad:labels .
Push it, and call your MicroBadger web hook
$ docker push <namespace>/tiad:labels
$ curl -X POST
https://hooks.microbadger.com/<your webhook>
3. Child images & inheritance
Some metadata gets handed down, and some doesn’t
Create a Dockerfile for a child image - call it
Dockerfile.child
FROM <namespace>/tiad:labels
CMD echo yo peeps
LABEL org.label-schema.description =
“Overwrites the old description”
Build the child image
$ docker build -f Dockerfile.child -t
<namespace>/tiadchild .
Push it
$ docker push <namespace>/tiadchild
Take a look at the child image on microbadger.com
Using FROM directive
- inherits labels
- doesn’t inherit MAINTAINER
TIAD 2016 : Using and abusing container metadata
You can filter images with particular labels:
$ docker images --filter "label=org.label-schema.name"
$ docker images --filter
"label=org.label-schema.name=TIAD test"
You can also filter running containers:
$ docker ps --filter "label=org.label-schema.name"
And apply labels at runtime
$ docker run --label "label=org.label-schema.name"
<namespace>/tiad:labels
Build-time labels - images are immutable
e.g.
- What code is in this image?
- Where is the documentation?
Run-time labels - can change after build
e.g.
- Test / acceptance status of this image
Add up-to-date git references into your image
4. Automate with a makefile
Initialize this directory under git
- or do this with an existing repo + image + Dockerfile
$ git init .
Add to Dockerfile:
ARG VCS_REF
LABEL org.label-schema.vcs-ref=$VCS_REF
Add substitution params to Dockerfile:
ARG VCS_REF
LABEL org.label-schema.vcs-ref=$VCS_REF
Build the image with value for that param:
$ docker build --build-arg VCS_REF=`git
rev-parse --short HEAD` .
You can include that as part of a Makefile, e.g.
default: docker_build
docker_build:
docker build 
--build-arg VCS_REF=`git rev-parse --short HEAD` 
--build-arg BUILD_DATE=`date -u +“%Y-%m-$dT%H:%M:%SZ”` .
What not to do!
● Apply ‘latest’ to an old image
● Use someone else’s email as the maintainer
● Don’t look at labels before you build from an image
MicroBadger.com
label-schema.org
@lizrice | @microscaling
Image: Peter Trimming

More Related Content

PPTX
TIAD 2016 : Application delivery in a container world
PDF
Building a Serverless Pipeline
PPTX
TIAD 2016 : Migrating 100% of your production services to containers
PPTX
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
PDF
ContainerDayVietnam2016: Django Development with Docker
PDF
Delivering Go.CD with Terraform and Docker
PDF
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
PPTX
Docker for Ops: Docker Storage and Volumes Deep Dive and Considerations by Br...
TIAD 2016 : Application delivery in a container world
Building a Serverless Pipeline
TIAD 2016 : Migrating 100% of your production services to containers
Thinking Inside the Container: A Continuous Delivery Story by Maxfield Stewart
ContainerDayVietnam2016: Django Development with Docker
Delivering Go.CD with Terraform and Docker
The Dockerfile Explosion and the Need for Higher Level Tools by Gareth Rushgrove
Docker for Ops: Docker Storage and Volumes Deep Dive and Considerations by Br...

What's hot (20)

PPTX
From Docker to Production - ZendCon 2016
PDF
Docker Advanced registry usage
PPTX
Docker Security workshop slides
PPTX
Scaling Development Environments with Docker
PDF
TIAD : Automating the aplication lifecycle
PDF
Docker serverless v1.0
PPTX
Dockerizing Windows Server Applications by Ender Barillas and Taylor Brown
PDF
Orchestrating Linux Containers while tolerating failures
PDF
Clocker - The Docker Cloud Maker
PPTX
Docker Container As A Service - March 2016
PPTX
Hashicorp: Delivering the Tao of DevOps
PDF
DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...
PDF
Things I've learned working with Docker Support
PPTX
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...
PDF
Docker storage designing a platform for persistent data
PDF
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
PDF
Fluentd and docker monitoring
PDF
Running Django on Docker: a workflow and code
PPTX
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
PDF
Cloning Running Servers with Docker and CRIU by Ross Boucher
From Docker to Production - ZendCon 2016
Docker Advanced registry usage
Docker Security workshop slides
Scaling Development Environments with Docker
TIAD : Automating the aplication lifecycle
Docker serverless v1.0
Dockerizing Windows Server Applications by Ender Barillas and Taylor Brown
Orchestrating Linux Containers while tolerating failures
Clocker - The Docker Cloud Maker
Docker Container As A Service - March 2016
Hashicorp: Delivering the Tao of DevOps
DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...
Things I've learned working with Docker Support
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...
Docker storage designing a platform for persistent data
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
Fluentd and docker monitoring
Running Django on Docker: a workflow and code
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
Cloning Running Servers with Docker and CRIU by Ross Boucher
Ad

Viewers also liked (7)

PPTX
Splunk for Enterprise Security featuring User Behavior Analytics
PDF
ManageIQ Overview at Management and Orchestration Developer (MODM) Meet-up
PPTX
Réunion de triage en holacratie v2
PDF
The Responsive Organization
PDF
Les Barbares attaquent les DSI ! Par Nicolas Colin, co-fondateur de TheFamily
PPTX
Micro Service Architecture
PDF
MicroService Architecture
Splunk for Enterprise Security featuring User Behavior Analytics
ManageIQ Overview at Management and Orchestration Developer (MODM) Meet-up
Réunion de triage en holacratie v2
The Responsive Organization
Les Barbares attaquent les DSI ! Par Nicolas Colin, co-fondateur de TheFamily
Micro Service Architecture
MicroService Architecture
Ad

Similar to TIAD 2016 : Using and abusing container metadata (20)

PPTX
Azure ai on premises with docker
PDF
Containers + Docker workshop - part 2
PDF
Docker Essentials Workshop— Innovation Labs July 2020
PDF
Data Science Workflows using Docker Containers
PPTX
Docker Introduction and its Usage in Machine Learning
PPTX
Docker Starter Pack
PPTX
Docker Kubernetes Istio
PPTX
Docker workshop
PDF
Clouds and Tools: Cheat Sheets & Infographics
ODP
Deploying Microservice on Docker
PDF
Testing with Docker
PPTX
Docker for developers z java
PDF
Docker在豆瓣的实践 刘天伟-20160709
PPTX
Docker and the Container Ecosystem
PDF
Computer science docker file Week -6 to7
PPSX
Docker Kubernetes Istio
PDF
Docker Intro
PPTX
Docker for Fun and Profit
PDF
Docker
PDF
時代在變 Docker 要會:台北 Docker 一日入門篇
Azure ai on premises with docker
Containers + Docker workshop - part 2
Docker Essentials Workshop— Innovation Labs July 2020
Data Science Workflows using Docker Containers
Docker Introduction and its Usage in Machine Learning
Docker Starter Pack
Docker Kubernetes Istio
Docker workshop
Clouds and Tools: Cheat Sheets & Infographics
Deploying Microservice on Docker
Testing with Docker
Docker for developers z java
Docker在豆瓣的实践 刘天伟-20160709
Docker and the Container Ecosystem
Computer science docker file Week -6 to7
Docker Kubernetes Istio
Docker Intro
Docker for Fun and Profit
Docker
時代在變 Docker 要會:台北 Docker 一日入門篇

More from The Incredible Automation Day (20)

PDF
A smooth migration to Docker focusing on build pipelines - TIAD Camp Docker
PDF
Docker in real life and in the Cloud - TIAD Camp Docker
PDF
Orchestrating Docker in production - TIAD Camp Docker
PDF
Monitoring in 2017 - TIAD Camp Docker
PDF
Strategy, planning and governance for enterprise deployments of containers - ...
PPTX
Cluster SQL - TIAD Camp Microsoft Cloud Readiness
PPTX
Build the VPC - TIAD Camp Microsoft Cloud Readiness
PPTX
Opening Keynote - TIAD Camp Microsoft Cloud Readiness
PPTX
Replatforming - TIAD Camp Microsoft Cloud Readiness
PPTX
GitLab CI Packer - TIAD Camp Microsoft Cloud Readiness
PPTX
Active Directory - TIAD Camp Microsoft Cloud Readiness
PPTX
Application Stack - TIAD Camp Microsoft Cloud Readiness
PPTX
Keynote TIAD Camp Serverless
PPTX
From AIX to Zero-ops by Pierre Baillet
PDF
Serverless low cost analytics by Adways y Audric Guigon
PPTX
Operationnal challenges behind Serverless architectures by Laurent Bernaille
PDF
Build chatbots with api.ai and Google cloud functions
PDF
Real time serverless data pipelines on AWS
PPTX
PPTX
TIAD 2016 - Beyond windowsautomation
A smooth migration to Docker focusing on build pipelines - TIAD Camp Docker
Docker in real life and in the Cloud - TIAD Camp Docker
Orchestrating Docker in production - TIAD Camp Docker
Monitoring in 2017 - TIAD Camp Docker
Strategy, planning and governance for enterprise deployments of containers - ...
Cluster SQL - TIAD Camp Microsoft Cloud Readiness
Build the VPC - TIAD Camp Microsoft Cloud Readiness
Opening Keynote - TIAD Camp Microsoft Cloud Readiness
Replatforming - TIAD Camp Microsoft Cloud Readiness
GitLab CI Packer - TIAD Camp Microsoft Cloud Readiness
Active Directory - TIAD Camp Microsoft Cloud Readiness
Application Stack - TIAD Camp Microsoft Cloud Readiness
Keynote TIAD Camp Serverless
From AIX to Zero-ops by Pierre Baillet
Serverless low cost analytics by Adways y Audric Guigon
Operationnal challenges behind Serverless architectures by Laurent Bernaille
Build chatbots with api.ai and Google cloud functions
Real time serverless data pipelines on AWS
TIAD 2016 - Beyond windowsautomation

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Empathic Computing: Creating Shared Understanding
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Cloud computing and distributed systems.
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
KodekX | Application Modernization Development
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PPT
Teaching material agriculture food technology
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Machine learning based COVID-19 study performance prediction
PDF
cuic standard and advanced reporting.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Network Security Unit 5.pdf for BCA BBA.
Dropbox Q2 2025 Financial Results & Investor Presentation
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Empathic Computing: Creating Shared Understanding
“AI and Expert System Decision Support & Business Intelligence Systems”
Cloud computing and distributed systems.
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
KodekX | Application Modernization Development
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Teaching material agriculture food technology
The AUB Centre for AI in Media Proposal.docx
Machine learning based COVID-19 study performance prediction
cuic standard and advanced reporting.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
MIND Revenue Release Quarter 2 2025 Press Release
Unlocking AI with Model Context Protocol (MCP)
Network Security Unit 5.pdf for BCA BBA.

TIAD 2016 : Using and abusing container metadata

  • 1. Using and abusing container metadata Liz Rice @lizrice | @microscaling speakerdeck.com/lizrice/using-and-abusing -container-metadata
  • 2. Agenda ● Container images and layers ● Container metadata and labels ● Metadata inheritance ● Metadata automation
  • 3. Frisbee whizzing through the air above our heads over the sand into the water onto the waves out to sea. You cried a lot that day. Frisbee was a lovely dog. Brian Bilston
  • 7. server Host OS bins / libs App A bins / libs App B image
  • 10. Create a new directory $ mkdir tiad # or whatever you like $ cd tiad Create a file called greeting, something like this Hello TIAD
  • 11. Create a file called Dockerfile FROM alpine:latest MAINTAINER <your@email.address> COPY greeting greeting CMD echo `cat greeting` Reverse quotes
  • 12. You’ll need a Docker Hub namespace - Your Docker Hub name - Or maybe an organization
  • 13. Build the container $ docker build -t <namespace>/tiad . Run it $ docker run <namespace>/tiad
  • 14. Push it to Docker Hub - You’ll need your Docker Hub repo name $ docker push <namespace>/tiad - You might need to log in first $ docker login
  • 15. Look at the image information $ docker inspect <namespace>/tiad ... "Author": "liz@lizrice.com", ... "Cmd": [ "/bin/sh", "-c", "echo `cat greeting`" ], ... "Layers": [ "sha256:9007f5987db353ec398a223bc5a135c5a9601798b... "sha256:182229f64cf81b7c99d6009c85764eb359f636f8df2... ...
  • 16. Look up your image on microbadger.com
  • 19. 2. Container metadata - Tagging - Labels
  • 21. Tagging Distinguish between different versions of the same image
  • 22. Edit the greeting file Build a new version of the container, with a new tag $ docker build -t <namespace>/tiad:new . Run it $ docker run <namespace>/tiad:new
  • 23. Push it $ docker push <namespace>/tiad:new Find the Webhook for your image on MicroBadger POST to it to trigger re-inspection $ curl -X POST https://hooks.microbadger.com/<your webhook>
  • 24. Look at it on Docker Hub (hub.docker.com) and MicroBadger - See both tagged versions (latest & new) - Which is most recent?
  • 28. git ref usage contact vendor Image Alarm system automatically connected to contactReproduce problem with precise codebase Filter deployed images from vendor
  • 29. Standard semantics for container labels label-schema.org
  • 30. Add labels in your Dockerfile FROM alpine:latest MAINTAINER <your@email.address> COPY greeting greeting CMD echo `cat greeting` LABEL org.label-schema.name=“TIAD test” org.label-schema.description=“Whatever you like”
  • 31. Build a new version of the container with another tag $ docker build -t <namespace>/tiad:labels . Push it, and call your MicroBadger web hook $ docker push <namespace>/tiad:labels $ curl -X POST https://hooks.microbadger.com/<your webhook>
  • 32. 3. Child images & inheritance Some metadata gets handed down, and some doesn’t
  • 33. Create a Dockerfile for a child image - call it Dockerfile.child FROM <namespace>/tiad:labels CMD echo yo peeps LABEL org.label-schema.description = “Overwrites the old description”
  • 34. Build the child image $ docker build -f Dockerfile.child -t <namespace>/tiadchild . Push it $ docker push <namespace>/tiadchild Take a look at the child image on microbadger.com
  • 35. Using FROM directive - inherits labels - doesn’t inherit MAINTAINER
  • 37. You can filter images with particular labels: $ docker images --filter "label=org.label-schema.name" $ docker images --filter "label=org.label-schema.name=TIAD test" You can also filter running containers: $ docker ps --filter "label=org.label-schema.name" And apply labels at runtime $ docker run --label "label=org.label-schema.name" <namespace>/tiad:labels
  • 38. Build-time labels - images are immutable e.g. - What code is in this image? - Where is the documentation? Run-time labels - can change after build e.g. - Test / acceptance status of this image
  • 39. Add up-to-date git references into your image 4. Automate with a makefile
  • 40. Initialize this directory under git - or do this with an existing repo + image + Dockerfile $ git init . Add to Dockerfile: ARG VCS_REF LABEL org.label-schema.vcs-ref=$VCS_REF
  • 41. Add substitution params to Dockerfile: ARG VCS_REF LABEL org.label-schema.vcs-ref=$VCS_REF Build the image with value for that param: $ docker build --build-arg VCS_REF=`git rev-parse --short HEAD` .
  • 42. You can include that as part of a Makefile, e.g. default: docker_build docker_build: docker build --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +“%Y-%m-$dT%H:%M:%SZ”` .
  • 43. What not to do! ● Apply ‘latest’ to an old image ● Use someone else’s email as the maintainer ● Don’t look at labels before you build from an image