SlideShare a Scribd company logo
1 of 68
Download to read offline
NICOLA PAOLUCCI โ€ข DEVELOPER INSTIGATOR โ€ข โ€ข @DURDN
The business case for Git
Tricks of the trade
Be a better developer with Docker
3 minute Docker
intro?
Deploying code to the
cloud is hard
ยฉ http://www.amigosdosbichos.org/
Tools, Tips and Hacks
2
3
The plan for this session:
Notes on Workflows and Techniques
1
Why does Docker make Developers happy?
Why?
Compulsion to have
clean and perfect
environments
ยฉ www.elephantlifestyle.com
The need for speed of every
developer with an idea
Fast application mobility,
Real repeatability
Cooperate smoothly with Ops or
run our own DevOps
@durdn
Building blocks for your
Micro-services Architecture
Micro-services Architecture Blueprint
@crichardson
Traditional Server-side
web apps
View Controller
Model
API
Gateway
Browser/Native App
View Controller
Model
REST
REST
REST
Product Info
Service
Recommendation
Service
Review
Service
Single entry point
Protocol translation
Client speci๏ฌc
APIs
Development Workflows
or
โ€œWhat can I do with it?โ€
Shared Volume Dev/Debug Container
2
3
Development workflows on Docker:
Create your โ€œbaseโ€ Container
1
Package your releases, push, run in PaaS
Development workflows on Docker:
Default-Official-Services-In-A-Box
5
6
The Installation Container
4
Test different versions of your tools
for more patterns read bit.do/docker-patterns by Vidar Hokstad
Basic Techniques
Pre-requisite: Dockerfiles
A list of instructions to automate building
your image. The steps are cached along
the way for fast re-use.
Dockerfiles: Repeatable Magic
FROM stackbrew/ubuntu:13.10
RUN apt-get update
RUN apt-get install -y software-โ€ฆ-common python โ€ฆ
RUN add-apt-repository -y ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get install -y nodejs
Reads like a shell script but each step is cached
Every RUN command creates a layer
RUN apt-get update unique id: ae983ebddโ€ฆ
RUN apt-get installโ€ฆ unique id: 285efddacaโ€ฆ
RUN apt-get clean unique id: 7aeffcd23aaโ€ฆ
copy-on-write filesystem
โ€œadd + buildโ€ routine magic
docker add <src> <dest>
docker add <src> <dest>
The ADD instruction copies new ๏ฌles
from hostโ€™s <src> to containerโ€™s <dest>
docker build your image with updated code
1
2
โ€œadd + buildโ€ routine magic?!
Update code in local app folder (git pull?)
Distribute and profit!3
Sharing data in containers
Container
Folder from host:
/app
Docker host
Host folder
/opt/test-app
-v /opt/test-app:/app
host to containers
share folder from
host to containers
docker run -v /opt/test-app:/app 
-i -t ubuntu /bin/bash
Use the run -v (volume option) to specify host/
container folder to be synced
From
is simple
Same pattern using Dockerfile
FROM busybox
VOLUME ["/var/volume1", "/var/volume2"]
CMD ["/bin/true"]
Common pattern: Data in containers
Docker host
/var/volume1
DATA
/var/volume2
Common pattern: data in containers
docker run -v /var/volume1 
-v /var/volume2 
--name DATA busybox true
Switched off, named, data container which
exposes a folder
Volumes
Docker host
/var/volume1
DATA
/var/volume2
/var/volume1
client1
/var/volume2
--volumes-from DATA
Common pattern: data in containers
docker run -t -i -rm --volumes-from DATA 
--name client1 ubuntu bash
Then mount the data container in your
application containers
--links: simple service
connections for docker
Linked containers
Docker host
postgresql client
--link postgresql:pg
can refer to
hostname pg
in commands
Sample access to linked container
docker build -t postgresql .
Build the image, run it with a name, 

link in child container
docker run -rm -P --name pg postgresql
docker run -rm -t -i --link pg:pg postgresql bash
psql -h pg -d docker -U docker --password
Tips & Hacks
Embrace Reusability in
Dockerfiles
Write general requirements early, commit and name
relevant checkpoints, leave customisations last
Base images off of
Debian
Avoid temporary files
Clean up after the
package manager
Combine commands
Combine commands when logical
FROM stackbrew/ubuntu:13.10
RUN apt-get update
RUN apt-get install -y software-โ€ฆ-common python โ€ฆ
RUN add-apt-repository -y ppa:chris-lea/node.js
RUN apt-get update
RUN apt-get install -y nodejs
This will cache every step โ€ฆ
Combine commands when logical
FROM stackbrew/ubuntu:13.10
RUN apt-get update && 
apt-get install -y python mysql && 
add-apt-repository -y ppa:chris-lea/node.js && 
apt-get update && 
apt-get install -y nodejs && apt-get clean
This will use one step for the dependencies setup!
Inspect space used by
your cached images
for more read http://bit.do/optimize-docker-images by Brian De Hamer
Use docker history to inspect the cost of
each cache point
[:~/p/tiny-stash] $ docker history durdn/bithub
IMAGE CREATED CREATED BY SIZE
df1e39df8dbf 8 weeks ago /bin/sh -c #(nop) COPY dir:e79c45cea3b302 737.5 kB
32a4d3158cdf 8 weeks ago /bin/sh -c #(nop) COPY multi:21d8695afff8 2.786 kB
aaae3444f54f 8 weeks ago /bin/sh -c #(nop) COPY file:d6d8f14a4e6d3 1.883 kB
23f7e46a4bbc 12 weeks ago /bin/sh -c apt-get update && apt-get inst 15.04 MB
4cae2a7ca6bb 12 weeks ago /bin/sh -c #(nop) ENV NGINX_VERSION=1.7.7 0 B
34806d38e48d 12 weeks ago /bin/sh -c echo "deb http://nginx.org/pac 211 B
04499cf33a0e 12 weeks ago /bin/sh -c apt-key adv --keyserver pgp.mi 37.88 kB
d21beea329f5 12 weeks ago /bin/sh -c #(nop) MAINTAINER NGINX Docker 0 B
f6fab3b798be 12 weeks ago /bin/sh -c #(nop) CMD [/bin/bash] 0 B
f10807909bc5 12 weeks ago /bin/sh -c #(nop) ADD file:01b419e635eb6b 85.1 MB
511136ea3c5a 19 months ago 0 B
docker images --tree
Use docker images --tree to get a
hierarchy graph of images
[:~/p/tiny-stash] $ docker images --tree
Warning: '--tree' is deprecated, it will be removed soon. See usage.
โ”œโ”€78f91b36638d Virtual Size: 11.1 MB
โ”‚ โ””โ”€f47686df00df Virtual Size: 11.1 MB Tags: spaceghost/tinycore-x86_64:5.4
โ”‚ โ””โ”€99387f49550f Virtual Size: 11.1 MB
โ”‚ โ””โ”€7c01ca6c30f2 Virtual Size: 11.1 MB
โ”œโ”€8cdd417ec611 Virtual Size: 7.426 MB Tags: zoobab/tinycore-x64:latest
โ”‚ โ””โ”€70f33d2549d9 Virtual Size: 7.426 MB
โ”‚ โ”œโ”€9518620e6a0e Virtual Size: 7.426 MB
โ”‚ โ””โ”€430707ee7fe8 Virtual Size: 7.426 MB
โ””โ”€511136ea3c5a Virtual Size: 0 B Tags: scratch:latest
โ”œโ”€1aeada447715 Virtual Size: 84.99 MB
โ”‚ โ””โ”€479215127fa7 Virtual Size: 84.99 MB
โ”‚ โ””โ”€813e49402d39 Virtual Size: 84.99 MB
โ”‚ โ””โ”€e6fe410e34bb Virtual Size: 324.5 MB
Sometimes itโ€™s nice
to flatten an image
Export and re-import the image
docker export aa3f12cc | docker import โ€“ myapp:stripped
This has the useful effect to flatten it to a single image
Export and re-import the image
$ docker history myapp:stripped
โ€จ
IMAGE CREATED CREATED BY SIZEโ€จ
ca132a1cae88 5 seconds ago 92.25 MB
This has the useful effect to flatten it to a single image
Cache your build
dependencies
more info at http://bit.do/skip-bundle-install by Brian Morearty
How do I cache โ€œbundle installโ€ ?
ADD my-app /opt/my-app
WORKDIR /opt/my-app
RUN bundle install
Split the dependency builder from the rest
of the source code addition
How do I cache โ€œbundle installโ€ ?
WORKDIR /tmp
ADD my-app/Gemfile Gemfile
ADD my-app/Gemfile.lock Gemfile.lock
RUN bundle install
ADD my-app /opt/my-app
WORKDIR /opt/my-app
Split the dependency builder from the rest
of the source code addition
Statically linked minimal
apps running in containers?
try Golang!
for more read http://bit.do/go-static by Adriaan De Jonge
The โ€œsecretโ€
scratch image
Add static binary to the smallest
container ever
FROM scratch
COPY static-binary /static-binary
CMD [โ€œ/static-binary"]
$ tar cv --files-from /dev/null | docker import - scratch
The Docker ecosystem
is moving fast!
docker machine
docker swarm
docker compose
Isolated dev environments
http://orchardup.github.io/๏ฌg/
The elevator is
going up!
NICOLA PAOLUCCI โ€ข DEVELOPER INSTIGATOR โ€ข ATLASSIAN โ€ข @DURDN
Thank you!
Mechelen - 26th November
@durdn

More Related Content

What's hot

Devfest 2021' - Artifact Registry Introduction (Taipei)
Devfest 2021' - Artifact Registry Introduction (Taipei)Devfest 2021' - Artifact Registry Introduction (Taipei)
Devfest 2021' - Artifact Registry Introduction (Taipei)KAI CHU CHUNG
ย 
Docker meetup - PaaS interoperability
Docker meetup - PaaS interoperabilityDocker meetup - PaaS interoperability
Docker meetup - PaaS interoperabilityLudovic Piot
ย 
From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017Chris Tankersley
ย 
Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing Ricardo Amaro
ย 
Cloud Driven Development: a better workflow, less worries, and more power
Cloud Driven Development: a better workflow, less worries, and more powerCloud Driven Development: a better workflow, less worries, and more power
Cloud Driven Development: a better workflow, less worries, and more powerMarzee Labs
ย 
Using Docker in the Real World
Using Docker in the Real WorldUsing Docker in the Real World
Using Docker in the Real WorldTim Haak
ย 
Docker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHPDocker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHPChris Tankersley
ย 
Docker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureDocker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureTerry Chen
ย 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to dockerMarcelo Cenerino
ย 
Using docker to develop NAS applications
Using docker to develop NAS applicationsUsing docker to develop NAS applications
Using docker to develop NAS applicationsTerry Chen
ย 
Deployment Automation with Docker
Deployment Automation with DockerDeployment Automation with Docker
Deployment Automation with DockerEgor Pushkin
ย 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 augVincent De Smet
ย 
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...On-Demand Image Resizing from Part of the monolith to Containerized Microserv...
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...Docker, Inc.
ย 
Drupal in Libraries
Drupal in LibrariesDrupal in Libraries
Drupal in LibrariesCary Gordon
ย 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutesLarry Cai
ย 
Build optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and DockerBuild optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and DockerDmytro Patkovskyi
ย 
Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveKazuto Kusama
ย 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stackDana Luther
ย 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationErica Windisch
ย 

What's hot (20)

Devfest 2021' - Artifact Registry Introduction (Taipei)
Devfest 2021' - Artifact Registry Introduction (Taipei)Devfest 2021' - Artifact Registry Introduction (Taipei)
Devfest 2021' - Artifact Registry Introduction (Taipei)
ย 
Docker meetup - PaaS interoperability
Docker meetup - PaaS interoperabilityDocker meetup - PaaS interoperability
Docker meetup - PaaS interoperability
ย 
From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017From Docker to Production - SunshinePHP 2017
From Docker to Production - SunshinePHP 2017
ย 
Docker
DockerDocker
Docker
ย 
Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing Docker containers & the Future of Drupal testing
Docker containers & the Future of Drupal testing
ย 
Cloud Driven Development: a better workflow, less worries, and more power
Cloud Driven Development: a better workflow, less worries, and more powerCloud Driven Development: a better workflow, less worries, and more power
Cloud Driven Development: a better workflow, less worries, and more power
ย 
Using Docker in the Real World
Using Docker in the Real WorldUsing Docker in the Real World
Using Docker in the Real World
ย 
Docker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHPDocker for Developers - Sunshine PHP
Docker for Developers - Sunshine PHP
ย 
Docker and DevOps --- new IT culture
Docker and DevOps --- new IT cultureDocker and DevOps --- new IT culture
Docker and DevOps --- new IT culture
ย 
Introduction to docker
Introduction to dockerIntroduction to docker
Introduction to docker
ย 
Using docker to develop NAS applications
Using docker to develop NAS applicationsUsing docker to develop NAS applications
Using docker to develop NAS applications
ย 
Deployment Automation with Docker
Deployment Automation with DockerDeployment Automation with Docker
Deployment Automation with Docker
ย 
Develop with docker 2014 aug
Develop with docker 2014 augDevelop with docker 2014 aug
Develop with docker 2014 aug
ย 
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...On-Demand Image Resizing from Part of the monolith to Containerized Microserv...
On-Demand Image Resizing from Part of the monolith to Containerized Microserv...
ย 
Drupal in Libraries
Drupal in LibrariesDrupal in Libraries
Drupal in Libraries
ย 
Learn docker in 90 minutes
Learn docker in 90 minutesLearn docker in 90 minutes
Learn docker in 90 minutes
ย 
Build optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and DockerBuild optimization mechanisms in GitLab and Docker
Build optimization mechanisms in GitLab and Docker
ย 
Cloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep DiveCloud Foundry V2 | Intermediate Deep Dive
Cloud Foundry V2 | Intermediate Deep Dive
ย 
Hands on Docker - Launch your own LEMP or LAMP stack
Hands on Docker -  Launch your own LEMP or LAMP stackHands on Docker -  Launch your own LEMP or LAMP stack
Hands on Docker - Launch your own LEMP or LAMP stack
ย 
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, OrchestrationThe Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
The Docker "Gauntlet" - Introduction, Ecosystem, Deployment, Orchestration
ย 

Similar to Be a better developer with Docker (revision 3)

Docker as an every day work tool
Docker as an every day work toolDocker as an every day work tool
Docker as an every day work toolPrzemyslaw Koltermann
ย 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with dockerGiacomo Bagnoli
ย 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in descriptionPrzemyslaw Koltermann
ย 
DCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker ContainersDCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker ContainersDocker, Inc.
ย 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with DockerDocker, Inc.
ย 
Using Docker For Development
Using Docker For DevelopmentUsing Docker For Development
Using Docker For DevelopmentLaura Frank Tacho
ย 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics Ganesh Samarthyam
ย 
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...Eric Smalling
ย 
Docker Demo @ IuK Seminar
Docker Demo @ IuK SeminarDocker Demo @ IuK Seminar
Docker Demo @ IuK SeminarMartin Scharm
ย 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned RightScale
ย 
Be a happier developer with Docker: Tricks of the trade
Be a happier developer with Docker: Tricks of the tradeBe a happier developer with Docker: Tricks of the trade
Be a happier developer with Docker: Tricks of the tradeNicola Paolucci
ย 
Learning Docker with Thomas
Learning Docker with ThomasLearning Docker with Thomas
Learning Docker with ThomasThomas Tong, FRM, PMP
ย 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to DockerCodeOps Technologies LLP
ย 
Be a Happier Developer with Docker: Tricks of the Trade
Be a Happier Developer with Docker: Tricks of the TradeBe a Happier Developer with Docker: Tricks of the Trade
Be a Happier Developer with Docker: Tricks of the TradeDocker, Inc.
ย 
ะ˜ัะฟะพะปัŒะทะพะฒะฐะฝะธะต Docker ะฒ CI / ะะปะตะบัะฐะฝะดั€ ะะบะฑะฐัˆะตะฒ (HERE Technologies)
ะ˜ัะฟะพะปัŒะทะพะฒะฐะฝะธะต Docker ะฒ CI / ะะปะตะบัะฐะฝะดั€ ะะบะฑะฐัˆะตะฒ (HERE Technologies)ะ˜ัะฟะพะปัŒะทะพะฒะฐะฝะธะต Docker ะฒ CI / ะะปะตะบัะฐะฝะดั€ ะะบะฑะฐัˆะตะฒ (HERE Technologies)
ะ˜ัะฟะพะปัŒะทะพะฒะฐะฝะธะต Docker ะฒ CI / ะะปะตะบัะฐะฝะดั€ ะะบะฑะฐัˆะตะฒ (HERE Technologies)Ontico
ย 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Aleksey Tkachenko
ย 
Docker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-ITDocker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-ITStijn Wijndaele
ย 
'DOCKER' & CLOUD: ENABLERS For DEVOPS
'DOCKER' & CLOUD:  ENABLERS For DEVOPS'DOCKER' & CLOUD:  ENABLERS For DEVOPS
'DOCKER' & CLOUD: ENABLERS For DEVOPSACA IT-Solutions
ย 
Docker module 1
Docker module 1Docker module 1
Docker module 1Liang Bo
ย 

Similar to Be a better developer with Docker (revision 3) (20)

Docker as an every day work tool
Docker as an every day work toolDocker as an every day work tool
Docker as an every day work tool
ย 
Streamline your development environment with docker
Streamline your development environment with dockerStreamline your development environment with docker
Streamline your development environment with docker
ย 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in description
ย 
DCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker ContainersDCEU 18: Developing with Docker Containers
DCEU 18: Developing with Docker Containers
ย 
Scaling Development Environments with Docker
Scaling Development Environments with DockerScaling Development Environments with Docker
Scaling Development Environments with Docker
ย 
Using Docker For Development
Using Docker For DevelopmentUsing Docker For Development
Using Docker For Development
ย 
Docker by Example - Basics
Docker by Example - Basics Docker by Example - Basics
Docker by Example - Basics
ย 
ABCs of docker
ABCs of dockerABCs of docker
ABCs of docker
ย 
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
ย 
Docker Demo @ IuK Seminar
Docker Demo @ IuK SeminarDocker Demo @ IuK Seminar
Docker Demo @ IuK Seminar
ย 
Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned  Real-World Docker: 10 Things We've Learned
Real-World Docker: 10 Things We've Learned
ย 
Be a happier developer with Docker: Tricks of the trade
Be a happier developer with Docker: Tricks of the tradeBe a happier developer with Docker: Tricks of the trade
Be a happier developer with Docker: Tricks of the trade
ย 
Learning Docker with Thomas
Learning Docker with ThomasLearning Docker with Thomas
Learning Docker with Thomas
ย 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
ย 
Be a Happier Developer with Docker: Tricks of the Trade
Be a Happier Developer with Docker: Tricks of the TradeBe a Happier Developer with Docker: Tricks of the Trade
Be a Happier Developer with Docker: Tricks of the Trade
ย 
ะ˜ัะฟะพะปัŒะทะพะฒะฐะฝะธะต Docker ะฒ CI / ะะปะตะบัะฐะฝะดั€ ะะบะฑะฐัˆะตะฒ (HERE Technologies)
ะ˜ัะฟะพะปัŒะทะพะฒะฐะฝะธะต Docker ะฒ CI / ะะปะตะบัะฐะฝะดั€ ะะบะฑะฐัˆะตะฒ (HERE Technologies)ะ˜ัะฟะพะปัŒะทะพะฒะฐะฝะธะต Docker ะฒ CI / ะะปะตะบัะฐะฝะดั€ ะะบะฑะฐัˆะตะฒ (HERE Technologies)
ะ˜ัะฟะพะปัŒะทะพะฒะฐะฝะธะต Docker ะฒ CI / ะะปะตะบัะฐะฝะดั€ ะะบะฑะฐัˆะตะฒ (HERE Technologies)
ย 
Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...Docman - The swiss army knife for Drupal multisite docroot management and dep...
Docman - The swiss army knife for Drupal multisite docroot management and dep...
ย 
Docker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-ITDocker and Cloud - Enables for DevOps - by ACA-IT
Docker and Cloud - Enables for DevOps - by ACA-IT
ย 
'DOCKER' & CLOUD: ENABLERS For DEVOPS
'DOCKER' & CLOUD:  ENABLERS For DEVOPS'DOCKER' & CLOUD:  ENABLERS For DEVOPS
'DOCKER' & CLOUD: ENABLERS For DEVOPS
ย 
Docker module 1
Docker module 1Docker module 1
Docker module 1
ย 

More from Nicola Paolucci

Transformative Git Practices
Transformative Git PracticesTransformative Git Practices
Transformative Git PracticesNicola Paolucci
ย 
The age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster managementThe age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster managementNicola Paolucci
ย 
Git Power Routines
Git Power RoutinesGit Power Routines
Git Power RoutinesNicola Paolucci
ย 
Becoming a Git Master
Becoming a Git MasterBecoming a Git Master
Becoming a Git MasterNicola Paolucci
ย 
Ninja Git: Save Your Master
Ninja Git: Save Your MasterNinja Git: Save Your Master
Ninja Git: Save Your MasterNicola Paolucci
ย 
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013Nicola Paolucci
ย 

More from Nicola Paolucci (6)

Transformative Git Practices
Transformative Git PracticesTransformative Git Practices
Transformative Git Practices
ย 
The age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster managementThe age of orchestration: from Docker basics to cluster management
The age of orchestration: from Docker basics to cluster management
ย 
Git Power Routines
Git Power RoutinesGit Power Routines
Git Power Routines
ย 
Becoming a Git Master
Becoming a Git MasterBecoming a Git Master
Becoming a Git Master
ย 
Ninja Git: Save Your Master
Ninja Git: Save Your MasterNinja Git: Save Your Master
Ninja Git: Save Your Master
ย 
Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013Real World Git Workflows - EclipseCon Europe 2013
Real World Git Workflows - EclipseCon Europe 2013
ย 

Recently uploaded

(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...Escorts Call Girls
ย 
๐“€คCall On 7877925207 ๐“€ค Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
๐“€คCall On 7877925207 ๐“€ค Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...๐“€คCall On 7877925207 ๐“€ค Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
๐“€คCall On 7877925207 ๐“€ค Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...Neha Pandey
ย 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...SUHANI PANDEY
ย 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceEscorts Call Girls
ย 
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service9953056974 Low Rate Call Girls In Saket, Delhi NCR
ย 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubaikojalkojal131
ย 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls DubaiEscorts Call Girls
ย 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...SUHANI PANDEY
ย 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirtrahman018755
ย 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableSeo
ย 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
ย 
Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...
Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...
Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...Delhi Call girls
ย 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...SUHANI PANDEY
ย 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...roncy bisnoi
ย 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...tanu pandey
ย 

Recently uploaded (20)

Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐ŸฅตLow Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
ย 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
ย 
๐“€คCall On 7877925207 ๐“€ค Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
๐“€คCall On 7877925207 ๐“€ค Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...๐“€คCall On 7877925207 ๐“€ค Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
๐“€คCall On 7877925207 ๐“€ค Ahmedguda Call Girls Hot Model With Sexy Bhabi Ready Fo...
ย 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
ย 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
ย 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
ย 
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
ย 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
ย 
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort ServiceCall Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
Call Girls in Prashant Vihar, Delhi ๐Ÿ’ฏ Call Us ๐Ÿ”9953056974 ๐Ÿ” Escort Service
ย 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
ย 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
ย 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
ย 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
ย 
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service AvailableCall Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
Call Girls Ludhiana Just Call 98765-12871 Top Class Call Girl Service Available
ย 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
ย 
Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...
Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...
Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...
ย 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
ย 
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
Call Girls Sangvi Call Me 7737669865 Budget Friendly No Advance BookingCall G...
ย 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
ย 
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...Nanded City ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready ...
Nanded City ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready ...
ย 

Be a better developer with Docker (revision 3)

  • 1. NICOLA PAOLUCCI โ€ข DEVELOPER INSTIGATOR โ€ข โ€ข @DURDN The business case for Git Tricks of the trade Be a better developer with Docker
  • 2.
  • 3.
  • 4.
  • 6. Deploying code to the cloud is hard
  • 7.
  • 9.
  • 10.
  • 11. Tools, Tips and Hacks 2 3 The plan for this session: Notes on Workflows and Techniques 1 Why does Docker make Developers happy?
  • 12. Why?
  • 13. Compulsion to have clean and perfect environments ยฉ www.elephantlifestyle.com
  • 14. The need for speed of every developer with an idea
  • 16. Cooperate smoothly with Ops or run our own DevOps
  • 17. @durdn Building blocks for your Micro-services Architecture
  • 18. Micro-services Architecture Blueprint @crichardson Traditional Server-side web apps View Controller Model API Gateway Browser/Native App View Controller Model REST REST REST Product Info Service Recommendation Service Review Service Single entry point Protocol translation Client speci๏ฌc APIs
  • 20. Shared Volume Dev/Debug Container 2 3 Development workflows on Docker: Create your โ€œbaseโ€ Container 1 Package your releases, push, run in PaaS
  • 21. Development workflows on Docker: Default-Official-Services-In-A-Box 5 6 The Installation Container 4 Test different versions of your tools for more patterns read bit.do/docker-patterns by Vidar Hokstad
  • 23. Pre-requisite: Dockerfiles A list of instructions to automate building your image. The steps are cached along the way for fast re-use.
  • 24. Dockerfiles: Repeatable Magic FROM stackbrew/ubuntu:13.10 RUN apt-get update RUN apt-get install -y software-โ€ฆ-common python โ€ฆ RUN add-apt-repository -y ppa:chris-lea/node.js RUN apt-get update RUN apt-get install -y nodejs Reads like a shell script but each step is cached
  • 25. Every RUN command creates a layer RUN apt-get update unique id: ae983ebddโ€ฆ RUN apt-get installโ€ฆ unique id: 285efddacaโ€ฆ RUN apt-get clean unique id: 7aeffcd23aaโ€ฆ copy-on-write filesystem
  • 26. โ€œadd + buildโ€ routine magic
  • 28. docker add <src> <dest> The ADD instruction copies new ๏ฌles from hostโ€™s <src> to containerโ€™s <dest>
  • 29. docker build your image with updated code 1 2 โ€œadd + buildโ€ routine magic?! Update code in local app folder (git pull?) Distribute and profit!3
  • 30. Sharing data in containers
  • 31. Container Folder from host: /app Docker host Host folder /opt/test-app -v /opt/test-app:/app host to containers share folder from
  • 32. host to containers docker run -v /opt/test-app:/app -i -t ubuntu /bin/bash Use the run -v (volume option) to specify host/ container folder to be synced From is simple
  • 33. Same pattern using Dockerfile FROM busybox VOLUME ["/var/volume1", "/var/volume2"] CMD ["/bin/true"]
  • 34. Common pattern: Data in containers Docker host /var/volume1 DATA /var/volume2
  • 35. Common pattern: data in containers docker run -v /var/volume1 -v /var/volume2 --name DATA busybox true Switched off, named, data container which exposes a folder
  • 37. Common pattern: data in containers docker run -t -i -rm --volumes-from DATA --name client1 ubuntu bash Then mount the data container in your application containers
  • 39. Linked containers Docker host postgresql client --link postgresql:pg can refer to hostname pg in commands
  • 40. Sample access to linked container docker build -t postgresql . Build the image, run it with a name, link in child container docker run -rm -P --name pg postgresql docker run -rm -t -i --link pg:pg postgresql bash psql -h pg -d docker -U docker --password
  • 42. Embrace Reusability in Dockerfiles Write general requirements early, commit and name relevant checkpoints, leave customisations last
  • 43. Base images off of Debian
  • 45. Clean up after the package manager
  • 47. Combine commands when logical FROM stackbrew/ubuntu:13.10 RUN apt-get update RUN apt-get install -y software-โ€ฆ-common python โ€ฆ RUN add-apt-repository -y ppa:chris-lea/node.js RUN apt-get update RUN apt-get install -y nodejs This will cache every step โ€ฆ
  • 48. Combine commands when logical FROM stackbrew/ubuntu:13.10 RUN apt-get update && apt-get install -y python mysql && add-apt-repository -y ppa:chris-lea/node.js && apt-get update && apt-get install -y nodejs && apt-get clean This will use one step for the dependencies setup!
  • 49. Inspect space used by your cached images for more read http://bit.do/optimize-docker-images by Brian De Hamer
  • 50. Use docker history to inspect the cost of each cache point [:~/p/tiny-stash] $ docker history durdn/bithub IMAGE CREATED CREATED BY SIZE df1e39df8dbf 8 weeks ago /bin/sh -c #(nop) COPY dir:e79c45cea3b302 737.5 kB 32a4d3158cdf 8 weeks ago /bin/sh -c #(nop) COPY multi:21d8695afff8 2.786 kB aaae3444f54f 8 weeks ago /bin/sh -c #(nop) COPY file:d6d8f14a4e6d3 1.883 kB 23f7e46a4bbc 12 weeks ago /bin/sh -c apt-get update && apt-get inst 15.04 MB 4cae2a7ca6bb 12 weeks ago /bin/sh -c #(nop) ENV NGINX_VERSION=1.7.7 0 B 34806d38e48d 12 weeks ago /bin/sh -c echo "deb http://nginx.org/pac 211 B 04499cf33a0e 12 weeks ago /bin/sh -c apt-key adv --keyserver pgp.mi 37.88 kB d21beea329f5 12 weeks ago /bin/sh -c #(nop) MAINTAINER NGINX Docker 0 B f6fab3b798be 12 weeks ago /bin/sh -c #(nop) CMD [/bin/bash] 0 B f10807909bc5 12 weeks ago /bin/sh -c #(nop) ADD file:01b419e635eb6b 85.1 MB 511136ea3c5a 19 months ago 0 B
  • 52. Use docker images --tree to get a hierarchy graph of images [:~/p/tiny-stash] $ docker images --tree Warning: '--tree' is deprecated, it will be removed soon. See usage. โ”œโ”€78f91b36638d Virtual Size: 11.1 MB โ”‚ โ””โ”€f47686df00df Virtual Size: 11.1 MB Tags: spaceghost/tinycore-x86_64:5.4 โ”‚ โ””โ”€99387f49550f Virtual Size: 11.1 MB โ”‚ โ””โ”€7c01ca6c30f2 Virtual Size: 11.1 MB โ”œโ”€8cdd417ec611 Virtual Size: 7.426 MB Tags: zoobab/tinycore-x64:latest โ”‚ โ””โ”€70f33d2549d9 Virtual Size: 7.426 MB โ”‚ โ”œโ”€9518620e6a0e Virtual Size: 7.426 MB โ”‚ โ””โ”€430707ee7fe8 Virtual Size: 7.426 MB โ””โ”€511136ea3c5a Virtual Size: 0 B Tags: scratch:latest โ”œโ”€1aeada447715 Virtual Size: 84.99 MB โ”‚ โ””โ”€479215127fa7 Virtual Size: 84.99 MB โ”‚ โ””โ”€813e49402d39 Virtual Size: 84.99 MB โ”‚ โ””โ”€e6fe410e34bb Virtual Size: 324.5 MB
  • 53. Sometimes itโ€™s nice to flatten an image
  • 54. Export and re-import the image docker export aa3f12cc | docker import โ€“ myapp:stripped This has the useful effect to flatten it to a single image
  • 55. Export and re-import the image $ docker history myapp:stripped โ€จ IMAGE CREATED CREATED BY SIZEโ€จ ca132a1cae88 5 seconds ago 92.25 MB This has the useful effect to flatten it to a single image
  • 56. Cache your build dependencies more info at http://bit.do/skip-bundle-install by Brian Morearty
  • 57. How do I cache โ€œbundle installโ€ ? ADD my-app /opt/my-app WORKDIR /opt/my-app RUN bundle install Split the dependency builder from the rest of the source code addition
  • 58. How do I cache โ€œbundle installโ€ ? WORKDIR /tmp ADD my-app/Gemfile Gemfile ADD my-app/Gemfile.lock Gemfile.lock RUN bundle install ADD my-app /opt/my-app WORKDIR /opt/my-app Split the dependency builder from the rest of the source code addition
  • 59. Statically linked minimal apps running in containers? try Golang! for more read http://bit.do/go-static by Adriaan De Jonge
  • 61. Add static binary to the smallest container ever FROM scratch COPY static-binary /static-binary CMD [โ€œ/static-binary"] $ tar cv --files-from /dev/null | docker import - scratch
  • 62. The Docker ecosystem is moving fast!
  • 68. NICOLA PAOLUCCI โ€ข DEVELOPER INSTIGATOR โ€ข ATLASSIAN โ€ข @DURDN Thank you! Mechelen - 26th November @durdn