SlideShare a Scribd company logo
1 of 44
Download to read offline
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
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?
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
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

What's hot

From Docker to Production - ZendCon 2016
From Docker to Production - ZendCon 2016From Docker to Production - ZendCon 2016
From Docker to Production - ZendCon 2016Chris Tankersley
 
Docker Advanced registry usage
Docker Advanced registry usageDocker Advanced registry usage
Docker Advanced registry usageDocker, Inc.
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slidesDocker, Inc.
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with DockerDocker, Inc.
 
Docker serverless v1.0
Docker serverless v1.0Docker serverless v1.0
Docker serverless v1.0Thomas Chacko
 
Dockerizing Windows Server Applications by Ender Barillas and Taylor Brown
Dockerizing Windows Server Applications by Ender Barillas and Taylor BrownDockerizing Windows Server Applications by Ender Barillas and Taylor Brown
Dockerizing Windows Server Applications by Ender Barillas and Taylor BrownDocker, Inc.
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresDocker, Inc.
 
Clocker - The Docker Cloud Maker
Clocker - The Docker Cloud MakerClocker - The Docker Cloud Maker
Clocker - The Docker Cloud MakerAndrew Kennedy
 
Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Patrick Chanezon
 
Hashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOpsHashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOpsRamit Surana
 
AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)
AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)
AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)Amazon Web Services
 
DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...
DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...
DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...Docker, Inc.
 
Things I've learned working with Docker Support
Things I've learned working with Docker SupportThings I've learned working with Docker Support
Things I've learned working with Docker SupportSujay Pillai
 
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...Docker, Inc.
 
Docker storage designing a platform for persistent data
Docker storage designing a platform for persistent dataDocker storage designing a platform for persistent data
Docker storage designing a platform for persistent dataDocker, Inc.
 
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...Docker, Inc.
 
Fluentd and docker monitoring
Fluentd and docker monitoringFluentd and docker monitoring
Fluentd and docker monitoringVinay Krishna
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeDanielle Madeley
 
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...Docker, Inc.
 

What's hot (20)

From Docker to Production - ZendCon 2016
From Docker to Production - ZendCon 2016From Docker to Production - ZendCon 2016
From Docker to Production - ZendCon 2016
 
Docker Advanced registry usage
Docker Advanced registry usageDocker Advanced registry usage
Docker Advanced registry usage
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
 
TIAD : Automating the aplication lifecycle
TIAD : Automating the aplication lifecycleTIAD : Automating the aplication lifecycle
TIAD : Automating the aplication lifecycle
 
Docker serverless v1.0
Docker serverless v1.0Docker serverless v1.0
Docker serverless v1.0
 
Dockerizing Windows Server Applications by Ender Barillas and Taylor Brown
Dockerizing Windows Server Applications by Ender Barillas and Taylor BrownDockerizing Windows Server Applications by Ender Barillas and Taylor Brown
Dockerizing Windows Server Applications by Ender Barillas and Taylor Brown
 
Orchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failuresOrchestrating Linux Containers while tolerating failures
Orchestrating Linux Containers while tolerating failures
 
Clocker - The Docker Cloud Maker
Clocker - The Docker Cloud MakerClocker - The Docker Cloud Maker
Clocker - The Docker Cloud Maker
 
Docker Container As A Service - March 2016
Docker Container As A Service - March 2016Docker Container As A Service - March 2016
Docker Container As A Service - March 2016
 
Hashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOpsHashicorp: Delivering the Tao of DevOps
Hashicorp: Delivering the Tao of DevOps
 
AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)
AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)
AWS re:Invent 2016: Amazon ECR Deep Dive on Image Optimization (CON401)
 
DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...
DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...
DockerCon EU 2015: Shipping Manifests, Bill of Lading and Docker Metadata and...
 
Things I've learned working with Docker Support
Things I've learned working with Docker SupportThings I've learned working with Docker Support
Things I've learned working with Docker Support
 
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...
 
Docker storage designing a platform for persistent data
Docker storage designing a platform for persistent dataDocker storage designing a platform for persistent data
Docker storage designing a platform for persistent data
 
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
Docker at Shopify: From This-Looks-Fun to Production by Simon Eskildsen (Shop...
 
Fluentd and docker monitoring
Fluentd and docker monitoringFluentd and docker monitoring
Fluentd and docker monitoring
 
Running Django on Docker: a workflow and code
Running Django on Docker: a workflow and codeRunning Django on Docker: a workflow and code
Running Django on Docker: a workflow and code
 
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
Windows Server and Docker - The Internals Behind Bringing Docker and Containe...
 

Viewers also liked

Splunk for Enterprise Security featuring User Behavior Analytics
Splunk for Enterprise Security featuring User Behavior AnalyticsSplunk for Enterprise Security featuring User Behavior Analytics
Splunk for Enterprise Security featuring User Behavior AnalyticsSplunk
 
ManageIQ Overview at Management and Orchestration Developer (MODM) Meet-up
ManageIQ Overview at Management and Orchestration Developer (MODM) Meet-upManageIQ Overview at Management and Orchestration Developer (MODM) Meet-up
ManageIQ Overview at Management and Orchestration Developer (MODM) Meet-upJerome Marc
 
Réunion de triage en holacratie v2
Réunion de triage en holacratie v2Réunion de triage en holacratie v2
Réunion de triage en holacratie v2Devoteam Revolve
 
The Responsive Organization
The Responsive OrganizationThe Responsive Organization
The Responsive OrganizationVladimir Pick
 
Les Barbares attaquent les DSI ! Par Nicolas Colin, co-fondateur de TheFamily
Les Barbares attaquent les DSI ! Par Nicolas Colin, co-fondateur de TheFamilyLes Barbares attaquent les DSI ! Par Nicolas Colin, co-fondateur de TheFamily
Les Barbares attaquent les DSI ! Par Nicolas Colin, co-fondateur de TheFamilyTheFamily
 
Micro Service Architecture
Micro Service ArchitectureMicro Service Architecture
Micro Service ArchitectureEduards Sizovs
 
MicroService Architecture
MicroService ArchitectureMicroService Architecture
MicroService ArchitectureFred George
 

Viewers also liked (7)

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

Similar to TIAD 2016 : Using and abusing container metadata

Docker Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshopRuncy Oommen
 
ABCing docker with environments - workshop
ABCing docker with environments - workshopABCing docker with environments - workshop
ABCing docker with environments - workshopVodqaBLR
 
Play With Docker
Play With DockerPlay With Docker
Play With DockerKarim Memon
 
Docker - from development to production (PHPNW 2017-09-05)
Docker - from development to production (PHPNW 2017-09-05)Docker - from development to production (PHPNW 2017-09-05)
Docker - from development to production (PHPNW 2017-09-05)Toby Griffiths
 
Docker & JVM: A Perfect Match
Docker & JVM: A Perfect MatchDocker & JVM: A Perfect Match
Docker & JVM: A Perfect MatchMatthias Grüter
 
Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Pini Reznik
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peekmsyukor
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruSwaminathan Vetri
 
Docker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google CloudDocker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google CloudSamuel Chow
 
Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Will Hall
 
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)Mike Melusky
 
Using Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowUsing Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowKarsten Dambekalns
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017Paul Chao
 

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

A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
 
Docker Introductory workshop
Docker Introductory workshopDocker Introductory workshop
Docker Introductory workshop
 
ABCing docker with environments - workshop
ABCing docker with environments - workshopABCing docker with environments - workshop
ABCing docker with environments - workshop
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
 
Docker by Example - Quiz
Docker by Example - QuizDocker by Example - Quiz
Docker by Example - Quiz
 
Play With Docker
Play With DockerPlay With Docker
Play With Docker
 
Docker - from development to production (PHPNW 2017-09-05)
Docker - from development to production (PHPNW 2017-09-05)Docker - from development to production (PHPNW 2017-09-05)
Docker - from development to production (PHPNW 2017-09-05)
 
Docker & JVM: A Perfect Match
Docker & JVM: A Perfect MatchDocker & JVM: A Perfect Match
Docker & JVM: A Perfect Match
 
Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014Docker workshop DevOpsDays Amsterdam 2014
Docker workshop DevOpsDays Amsterdam 2014
 
Docker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak PeekDocker for Web Developers: A Sneak Peek
Docker for Web Developers: A Sneak Peek
 
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local BengaluruDeploying .net core apps to Docker - dotnetConf Local Bengaluru
Deploying .net core apps to Docker - dotnetConf Local Bengaluru
 
Docker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google CloudDocker, Kubernetes, and Google Cloud
Docker, Kubernetes, and Google Cloud
 
Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers Docker Command Line, Using and Choosing containers
Docker Command Line, Using and Choosing containers
 
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)
 
Using Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 FlowUsing Document Databases with TYPO3 Flow
Using Document Databases with TYPO3 Flow
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
 
DevOps: Docker Workshop
DevOps: Docker WorkshopDevOps: Docker Workshop
DevOps: Docker Workshop
 
Docker
DockerDocker
Docker
 

More from The Incredible Automation Day

A smooth migration to Docker focusing on build pipelines - TIAD Camp Docker
A smooth migration to Docker focusing on build pipelines - TIAD Camp DockerA smooth migration to Docker focusing on build pipelines - TIAD Camp Docker
A smooth migration to Docker focusing on build pipelines - TIAD Camp DockerThe Incredible Automation Day
 
Docker in real life and in the Cloud - TIAD Camp Docker
Docker in real life and in the Cloud - TIAD Camp DockerDocker in real life and in the Cloud - TIAD Camp Docker
Docker in real life and in the Cloud - TIAD Camp DockerThe Incredible Automation Day
 
Orchestrating Docker in production - TIAD Camp Docker
Orchestrating Docker in production - TIAD Camp DockerOrchestrating Docker in production - TIAD Camp Docker
Orchestrating Docker in production - TIAD Camp DockerThe Incredible Automation Day
 
Strategy, planning and governance for enterprise deployments of containers - ...
Strategy, planning and governance for enterprise deployments of containers - ...Strategy, planning and governance for enterprise deployments of containers - ...
Strategy, planning and governance for enterprise deployments of containers - ...The Incredible Automation Day
 
Opening Keynote - TIAD Camp Microsoft Cloud Readiness
Opening Keynote - TIAD Camp Microsoft Cloud ReadinessOpening Keynote - TIAD Camp Microsoft Cloud Readiness
Opening Keynote - TIAD Camp Microsoft Cloud ReadinessThe Incredible Automation Day
 
GitLab CI Packer - TIAD Camp Microsoft Cloud Readiness
GitLab CI Packer - TIAD Camp Microsoft Cloud ReadinessGitLab CI Packer - TIAD Camp Microsoft Cloud Readiness
GitLab CI Packer - TIAD Camp Microsoft Cloud ReadinessThe Incredible Automation Day
 
Active Directory - TIAD Camp Microsoft Cloud Readiness
Active Directory - TIAD Camp Microsoft Cloud ReadinessActive Directory - TIAD Camp Microsoft Cloud Readiness
Active Directory - TIAD Camp Microsoft Cloud ReadinessThe Incredible Automation Day
 
Application Stack - TIAD Camp Microsoft Cloud Readiness
Application Stack - TIAD Camp Microsoft Cloud ReadinessApplication Stack - TIAD Camp Microsoft Cloud Readiness
Application Stack - TIAD Camp Microsoft Cloud ReadinessThe Incredible Automation Day
 
Serverless low cost analytics by Adways y Audric Guigon
Serverless low cost analytics by Adways y Audric GuigonServerless low cost analytics by Adways y Audric Guigon
Serverless low cost analytics by Adways y Audric GuigonThe Incredible Automation Day
 
Operationnal challenges behind Serverless architectures by Laurent Bernaille
Operationnal challenges behind Serverless architectures by Laurent BernailleOperationnal challenges behind Serverless architectures by Laurent Bernaille
Operationnal challenges behind Serverless architectures by Laurent BernailleThe Incredible Automation Day
 
Build chatbots with api.ai and Google cloud functions
Build chatbots with api.ai and Google cloud functionsBuild chatbots with api.ai and Google cloud functions
Build chatbots with api.ai and Google cloud functionsThe Incredible Automation Day
 

More from The Incredible Automation Day (20)

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

Recently uploaded

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 

Recently uploaded (20)

DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 

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
  • 20.
  • 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?
  • 25.
  • 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
  • 36.
  • 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