SlideShare a Scribd company logo
Docker multi-stage build
Using Docker multi-stage build
to create advanced build pipelines
About me…
•Chief of Research @codefresh.io
•github.com/alexei-led/pumba
•#docker, #golang, #aws
•medium.com/@alexeiled
•@alexeiled
Docker build
• Dockerfile - imperative DSL that defines build
commands
• Each docker build command generates ONE
image layer
• Complete docker build execution generates ONE
Docker image
janloeffler/html-demo Image Layers
nginx Dockerfile
html-demo Dockerfile
Problem with Docker Build
application
configuration
runtime
Image we want
application
configuration
runtime
code, build and test logs, …
linters, tests, profilers, …
compilers, debuggers, …
Image we build
x (4..10)
Docker Builder Pattern
• 2 Dockerfiles
• 1st for build tools
• 2nd for runtime
• Drawbacks
• 2+ Dockerfiles
• Orchestration needed: Bash, make, YAML, …
Docker multi-stage build
✓ Benefits
✓ One Dockerfile
✓ One sytntax to learn
✓ Same Build
✓ Local and CI
✓ Create multiple
stages
curl
FROM: alpine:3.5
/hello
FROM: ubuntu
/world
FROM: debian
/hello
FROM: base
/world
Node.js multi-stage build
https://github.com/codefreshdemo/demochat/tree/multistage
Builder (Alpine) Runtime (Alpine)
Content
Node.js
App Modules
Yarn (package)
Mocha (testing)
Eslint (linter)
Newman (REST testing)
Gulp (automation)
nsp (security scanner)
Istanbul (coverage)
Python
gcc, g++, krb5-dev, …
Node.js
App Modules
Yarn (package)
Size 568 MB 112 MB
Go multi-stage build
https://github.com/gaia-adm/pumba/tree/multistage
Builder (Alpine) Runtime (Alpine)
Content
go 1.8
glide (package)
cover (coverage)
go test (testing)
git
github-release (release)
goveralls (coveralls.io)
Bats (testing)
Bash
curl, openssl
Docker CLI
pumba
Size 427 MB 15 MB
Docker multi-stage with
codefresh.io
Multi-build Use Case
serviceA:v1 serviceB:v2 serviceC:v1 serviceD:v1.1
$ label = “LABEL name=serviceA”
$ tag = “serviceA:v1”
$ docker tag $(docker history 224f4fee5ec1 | grep $label | awk '{print $1}') $tag
✓One Dockerfile
✓Many Docker images
Docker Builder Pattern
• Sign up for a free Codefresh account at -
www.codefresh.io
• Additional info on Docker Driven Development -
www.codefresh.io/blog
• Meetups & Webinars -
www.codefresh.io/meetups
• Twitter - @codefresh
https://codefresh.io/blog/node_docker_multistage/

More Related Content

What's hot (20)

PDF
Azure Meetup Stuttgart - Multi-arch Docker images
Stefan Scherer
 
PPTX
Developer South Coast 2018: Docker on Windows - The Beginner's Guide
Elton Stoneman
 
PPTX
Docker for .NET Developers
Taswar Bhatti
 
PDF
How to Improve Your Image Builds Using Advance Docker Build
Docker, Inc.
 
PDF
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
Docker, Inc.
 
PDF
Lessons Learned: Using Concourse In Production
Shingo Omura
 
PDF
Continuous Integration with Docker on AWS
Andrew Heifetz
 
PDF
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
Eric Smalling
 
PPTX
Containers #101 : Docker ONBUILD triggers and Introduction to Docker Compose
Raziel Tabib (Join our team)
 
PDF
Introducción a contenedores Docker
Software Guru
 
PPTX
Continuous Delivery With Selenium Grid And Docker
Barbara Gonzalez
 
PDF
Deployment Automation with Docker
Egor Pushkin
 
PDF
DockerCon US 2016 - Extending Docker With APIs, Drivers, and Plugins
Arnaud Porterie
 
PPTX
Modernizing Traditional Apps with Docker Enterprise Edition
Elton Stoneman
 
PPTX
Hooking Docker With Selenium
Sujith Vakathanam
 
PPTX
Docker Indy Meetup - CICD 26-May-2015
Matt Bentley
 
PPTX
SQL Sever on Docker: Database Containers 3 Ways
Elton Stoneman
 
PPTX
TechDays NL 2017: The Hybrid Docker Swarm
Elton Stoneman
 
PDF
"Workstation Up" - Docker Development at Flow by Mike Roth
Docker, Inc.
 
PPTX
Azure container service docker-ha noi com
Van Phuc
 
Azure Meetup Stuttgart - Multi-arch Docker images
Stefan Scherer
 
Developer South Coast 2018: Docker on Windows - The Beginner's Guide
Elton Stoneman
 
Docker for .NET Developers
Taswar Bhatti
 
How to Improve Your Image Builds Using Advance Docker Build
Docker, Inc.
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
Docker, Inc.
 
Lessons Learned: Using Concourse In Production
Shingo Omura
 
Continuous Integration with Docker on AWS
Andrew Heifetz
 
IBM Index 2018 Conference Workshop: Modernizing Traditional Java App's with D...
Eric Smalling
 
Containers #101 : Docker ONBUILD triggers and Introduction to Docker Compose
Raziel Tabib (Join our team)
 
Introducción a contenedores Docker
Software Guru
 
Continuous Delivery With Selenium Grid And Docker
Barbara Gonzalez
 
Deployment Automation with Docker
Egor Pushkin
 
DockerCon US 2016 - Extending Docker With APIs, Drivers, and Plugins
Arnaud Porterie
 
Modernizing Traditional Apps with Docker Enterprise Edition
Elton Stoneman
 
Hooking Docker With Selenium
Sujith Vakathanam
 
Docker Indy Meetup - CICD 26-May-2015
Matt Bentley
 
SQL Sever on Docker: Database Containers 3 Ways
Elton Stoneman
 
TechDays NL 2017: The Hybrid Docker Swarm
Elton Stoneman
 
"Workstation Up" - Docker Development at Flow by Mike Roth
Docker, Inc.
 
Azure container service docker-ha noi com
Van Phuc
 

Similar to Webinar: Using Docker Multi-stage Build to Create Advanced Pipelines (20)

PDF
Why You Should be Using Multi-stage Docker Builds in 2019
Codefresh
 
PPTX
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
DevOps.com
 
PPTX
Multi-stage Docker builds to make building easy!
Milindu Sanoj Kumarage
 
PDF
Docker Multi-Stage Builds
Ryan Blunden
 
PPTX
Simply your Jenkins Projects with Docker Multi-Stage Builds
Eric Smalling
 
PPTX
Lean & mean applications using Docker EE and golang
Anoop Kumar
 
PDF
Crafting build pipelines with Docker
Ashley Davis
 
PPTX
Setup docker on existing application
Luc Juggery
 
PDF
Introduction to Docker - VIT Campus
Ajeet Singh Raina
 
PDF
Building distribution packages with Docker
Bruno Cornec
 
PDF
Scale Big With Docker — Moboom 2014
Jérôme Petazzoni
 
PPTX
Docker Fundamasadsasdasdassadentals 101 - Dark.pptx
MuhamedAhmed35
 
PDF
Butter bei die Fische - Ein Jahr Entwicklung und Produktion mit Docker
johannesunterstein
 
ODP
Introduction to Docker for NodeJs developers at Node DC 2/26/2014
lenworthhenry
 
PDF
Killer Docker Workflows for Development
Chris Tankersley
 
PDF
GDGSCL - Docker a jeho provoz v Heroku a AWS
Ladislav Prskavec
 
PDF
Introduction to Docker - Vellore Institute of Technology
Ajeet Singh Raina
 
PDF
Perspectives on Docker
RightScale
 
PDF
Docker introduction
Julien Maitrehenry
 
PPTX
Dockerizing a Symfony2 application
Roman Rodomansky
 
Why You Should be Using Multi-stage Docker Builds in 2019
Codefresh
 
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
DevOps.com
 
Multi-stage Docker builds to make building easy!
Milindu Sanoj Kumarage
 
Docker Multi-Stage Builds
Ryan Blunden
 
Simply your Jenkins Projects with Docker Multi-Stage Builds
Eric Smalling
 
Lean & mean applications using Docker EE and golang
Anoop Kumar
 
Crafting build pipelines with Docker
Ashley Davis
 
Setup docker on existing application
Luc Juggery
 
Introduction to Docker - VIT Campus
Ajeet Singh Raina
 
Building distribution packages with Docker
Bruno Cornec
 
Scale Big With Docker — Moboom 2014
Jérôme Petazzoni
 
Docker Fundamasadsasdasdassadentals 101 - Dark.pptx
MuhamedAhmed35
 
Butter bei die Fische - Ein Jahr Entwicklung und Produktion mit Docker
johannesunterstein
 
Introduction to Docker for NodeJs developers at Node DC 2/26/2014
lenworthhenry
 
Killer Docker Workflows for Development
Chris Tankersley
 
GDGSCL - Docker a jeho provoz v Heroku a AWS
Ladislav Prskavec
 
Introduction to Docker - Vellore Institute of Technology
Ajeet Singh Raina
 
Perspectives on Docker
RightScale
 
Docker introduction
Julien Maitrehenry
 
Dockerizing a Symfony2 application
Roman Rodomansky
 
Ad

More from Codefresh (20)

PDF
Detect, debug, deploy with Codefresh and Lightstep
Codefresh
 
PDF
CICD Pipelines for Microservices: Lessons from the Trenches
Codefresh
 
PDF
Simplify Your Code with Helmfile
Codefresh
 
PDF
Making the Most of Helm 3 with Codefresh
Codefresh
 
PDF
5 Simple Tips for Troubleshooting Your Kubernetes Pods
Codefresh
 
PDF
Best Practices for Microservice CI/CD: Lessons from Expedia and Codefresh
Codefresh
 
PDF
Hybrid CI/CD with Kubernetes & Codefresh
Codefresh
 
PDF
VM vs Docker-Based Pipelines
Codefresh
 
PPTX
Deploy Secure Cloud-Native Apps Fast
Codefresh
 
PDF
CICD Pipelines for Microservices Best Practices
Codefresh
 
PDF
Codefresh CICD New Features Launch! May 2019
Codefresh
 
PDF
Terraform GitOps on Codefresh
Codefresh
 
PDF
Adding Container Image Scanning to Your Codefresh Pipelines with Anchore
Codefresh
 
PDF
Image scanning using Clair
Codefresh
 
PDF
Updating Kubernetes With Helm Charts: Build, Test, Deploy with Codefresh and...
Codefresh
 
PDF
Docker based-Pipelines with Codefresh
Codefresh
 
PDF
Automated Serverless Pipelines with #GitOps on Codefresh
Codefresh
 
PDF
Discovering and Fixing Dependency Vulnerabilities for Kubernetes apps with Sn...
Codefresh
 
PDF
Net Pipeline on Windows Kubernetes
Codefresh
 
PPTX
Multi-cloud CI/CD with failover powered by K8s, Istio, Helm, and Codefresh
Codefresh
 
Detect, debug, deploy with Codefresh and Lightstep
Codefresh
 
CICD Pipelines for Microservices: Lessons from the Trenches
Codefresh
 
Simplify Your Code with Helmfile
Codefresh
 
Making the Most of Helm 3 with Codefresh
Codefresh
 
5 Simple Tips for Troubleshooting Your Kubernetes Pods
Codefresh
 
Best Practices for Microservice CI/CD: Lessons from Expedia and Codefresh
Codefresh
 
Hybrid CI/CD with Kubernetes & Codefresh
Codefresh
 
VM vs Docker-Based Pipelines
Codefresh
 
Deploy Secure Cloud-Native Apps Fast
Codefresh
 
CICD Pipelines for Microservices Best Practices
Codefresh
 
Codefresh CICD New Features Launch! May 2019
Codefresh
 
Terraform GitOps on Codefresh
Codefresh
 
Adding Container Image Scanning to Your Codefresh Pipelines with Anchore
Codefresh
 
Image scanning using Clair
Codefresh
 
Updating Kubernetes With Helm Charts: Build, Test, Deploy with Codefresh and...
Codefresh
 
Docker based-Pipelines with Codefresh
Codefresh
 
Automated Serverless Pipelines with #GitOps on Codefresh
Codefresh
 
Discovering and Fixing Dependency Vulnerabilities for Kubernetes apps with Sn...
Codefresh
 
Net Pipeline on Windows Kubernetes
Codefresh
 
Multi-cloud CI/CD with failover powered by K8s, Istio, Helm, and Codefresh
Codefresh
 
Ad

Recently uploaded (20)

PDF
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
PDF
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
PDF
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PDF
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
PDF
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PDF
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Newgen Beyond Frankenstein_Build vs Buy_Digital_version.pdf
darshakparmar
 
UPDF - AI PDF Editor & Converter Key Features
DealFuel
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Automating Feature Enrichment and Station Creation in Natural Gas Utility Net...
Safe Software
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Future-Proof or Fall Behind? 10 Tech Trends You Can’t Afford to Ignore in 2025
DIGITALCONFEX
 
Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
AI Agents in the Cloud: The Rise of Agentic Cloud Architecture
Lilly Gracia
 
NLJUG Speaker academy 2025 - first session
Bert Jan Schrijver
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
Peak of Data & AI Encore AI-Enhanced Workflows for the Real World
Safe Software
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 

Webinar: Using Docker Multi-stage Build to Create Advanced Pipelines