SlideShare a Scribd company logo
1 of 17
Download to read offline
Why you should be using Multi-Stage
Docker Builds in 2019
GUY SALTON
Guy
Salton
Solutions Architect
guy.salton@codefresh.io
Agenda
● The problem with Docker build
● Solution: Docker multi-stage build
● Docker multi-stage build in CI/CD
● Summary
● Dockerfile and Docker build
https://github.com/codefresh-contrib/golang-sample-app/
https://codefresh.io/docs/docs/learn-by-example/golang/golang-hello-world/
Docker multi-stage build
● “oh man! thank you! I've been fighting with build times on an image stack for weeks”
● “Wow, this is great for deploying tonnes of microservices!”
● “I've been meaning to use multistage builds, thanks for the walkthrough!”
https://www.reddit.com/r/golang/comments/crkibq/docker_golang_reducing_container_size_using/
Multi-stage build is available starting from Docker 17.05 (released in 2017!) - so why now?
Dockerfile and 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
Dockerfile and Docker build
Demo 1:
Docker build on GO app
https://github.com/codefresh-contrib/helm-sample-app
The Problem with Docker build
Image we want Image we build
runtime
configuration
application
Compilers, debuggers, ...
Linters, tests, profilers, ...
code, build and test logs, ...
runtime
configuration
application
X (4..10)
The Problem with Docker build
● 2 Dockerfiles
○ 1st for build tools
○ 2nd for runtime
● Drawbacks
○ 2+ Dockerfiles
○ Orchestration needed: Bash, make, YAML, ...
Solution: Docker multi-stage build
● Benefits
○ One Dockerfile
○ One syntax to learn
○ Same build
■ Local and CI
○ Create multiple stages
guy.salton@codefresh.io
FROM: alpine:3.5
curl
FROM: ubuntu
/hello
FROM: debian
/world
FROM: base
/hello
/world
Demo 2:
Docker multi-stage build
Docker multi-stage build
You can enjoy multi-stage build with every programming language (not only GO):
● GO example - https://codefresh.io/docs/docs/learn-by-example/golang/golang-hello-world/#create-a-multi-stage-docker-image-for-go
● JAVA example - https://codefresh.io/docs/docs/learn-by-example/java/spring-boot-2/#spring-boot-2-and-docker-multi-stage-builds
● Node example - https://codefresh.io/docs/docs/learn-by-example/nodejs/react/#react-and-docker-multi-stage-builds
● PHP example - https://codefresh.io/docs/docs/learn-by-example/php/#the-example-php-project
https://codefresh.io/containers/docker-anti-patterns/Docker anti-patterns
Codefresh
The 1st container-native
CI/CD Platform for
Microservices
Container-native
Intuitive & Robust
Enterprise Ready
Flexible Delivery
Demo 3:
Docker multi-stage build in CI/CD
Summary
● Using 1 Docker image for both build and
production results in slow deployment and
lots of CVE violations
● Multi-stage build to produce lean, secure
and production ready Docker image
● On Codefresh, speedier builds thanks to
caching across all images and layers
Signup for a FREE account with
UNLIMITED builds
& schedule a 1:1 with
our experts at
https://codefresh.io
Build Fast,
Deploy Faster
Thank You!
guy.salton@codefresh.io

More Related Content

What's hot

Deploying containerized applications with Kubeapps
Deploying containerized applications with KubeappsDeploying containerized applications with Kubeapps
Deploying containerized applications with KubeappsJanakiram MSV
 
Automate The Creation/Transformation of Infrastructure as Code Artifacts with...
Automate The Creation/Transformation of Infrastructure as Code Artifacts with...Automate The Creation/Transformation of Infrastructure as Code Artifacts with...
Automate The Creation/Transformation of Infrastructure as Code Artifacts with...Konveyor Community
 
How to Modernize Virtualized Workloads
How to Modernize Virtualized Workloads  How to Modernize Virtualized Workloads
How to Modernize Virtualized Workloads Konveyor Community
 
Microservice Development Using Telepresence
Microservice Development Using TelepresenceMicroservice Development Using Telepresence
Microservice Development Using TelepresenceVishal Banthia
 
Continuous Delivery to Kubernetes Using Helm
Continuous Delivery to Kubernetes Using HelmContinuous Delivery to Kubernetes Using Helm
Continuous Delivery to Kubernetes Using HelmAdnan Abdulhussein
 
[Konveyor] adding security to dev ops for your kubernetes native applications
[Konveyor] adding security to dev ops for your kubernetes native applications [Konveyor] adding security to dev ops for your kubernetes native applications
[Konveyor] adding security to dev ops for your kubernetes native applications Konveyor Community
 
Thinking One Step Further with Time-saving DevOps Tools with Open Telekom Clo...
Thinking One Step Further with Time-saving DevOps Tools with Open Telekom Clo...Thinking One Step Further with Time-saving DevOps Tools with Open Telekom Clo...
Thinking One Step Further with Time-saving DevOps Tools with Open Telekom Clo...Bitnami
 
Docker 1.5 features - South Bay Microservices meetup March 2015
Docker 1.5 features - South Bay Microservices meetup March 2015Docker 1.5 features - South Bay Microservices meetup March 2015
Docker 1.5 features - South Bay Microservices meetup March 2015Ritesh Patel
 
Versioning in Pipeline Pilot - Pipeline Pilot Forum 2018
Versioning in Pipeline Pilot - Pipeline Pilot Forum 2018Versioning in Pipeline Pilot - Pipeline Pilot Forum 2018
Versioning in Pipeline Pilot - Pipeline Pilot Forum 2018Peter Schmidtke
 
From development to production: Deploying Java and Scala apps to kubernetes
From development to production: Deploying Java and Scala apps to kubernetesFrom development to production: Deploying Java and Scala apps to kubernetes
From development to production: Deploying Java and Scala apps to kubernetesOlanga Ochieng'
 
Dr. Strangeconfig or: How I Learned to Stop Using Chef and Puppet and Love th...
Dr. Strangeconfig or: How I Learned to Stop Using Chef and Puppet and Love th...Dr. Strangeconfig or: How I Learned to Stop Using Chef and Puppet and Love th...
Dr. Strangeconfig or: How I Learned to Stop Using Chef and Puppet and Love th...Amir Moghimi
 
Migrating Java JBoss EAP Applications to Kubernetes With S2I
Migrating Java JBoss EAP Applications to Kubernetes With S2IMigrating Java JBoss EAP Applications to Kubernetes With S2I
Migrating Java JBoss EAP Applications to Kubernetes With S2IKonveyor Community
 
Cost Control and Rapid Innovation in Kubernetes with OpenRewrite
Cost Control and Rapid Innovation in Kubernetes with OpenRewriteCost Control and Rapid Innovation in Kubernetes with OpenRewrite
Cost Control and Rapid Innovation in Kubernetes with OpenRewriteKonveyor Community
 
Kubernetes buildpacks - from a source code to the running OCI container with ...
Kubernetes buildpacks - from a source code to the running OCI container with ...Kubernetes buildpacks - from a source code to the running OCI container with ...
Kubernetes buildpacks - from a source code to the running OCI container with ...PROIDEA
 
A mini adventure in Minikube devopsdays CT 2017
A mini adventure in Minikube devopsdays CT 2017A mini adventure in Minikube devopsdays CT 2017
A mini adventure in Minikube devopsdays CT 2017Whitney Tennant
 
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...Publicis Sapient Engineering
 
An Introduction to Docker
An Introduction to DockerAn Introduction to Docker
An Introduction to Dockerbwinterton
 
Cicd pixelfederation
Cicd pixelfederationCicd pixelfederation
Cicd pixelfederationJuraj Hantak
 
Containers and Orchestration approaches
Containers and Orchestration approachesContainers and Orchestration approaches
Containers and Orchestration approacheskloia
 

What's hot (20)

Deploying containerized applications with Kubeapps
Deploying containerized applications with KubeappsDeploying containerized applications with Kubeapps
Deploying containerized applications with Kubeapps
 
CRI, OCI, and CRI-O
CRI, OCI, and CRI-OCRI, OCI, and CRI-O
CRI, OCI, and CRI-O
 
Automate The Creation/Transformation of Infrastructure as Code Artifacts with...
Automate The Creation/Transformation of Infrastructure as Code Artifacts with...Automate The Creation/Transformation of Infrastructure as Code Artifacts with...
Automate The Creation/Transformation of Infrastructure as Code Artifacts with...
 
How to Modernize Virtualized Workloads
How to Modernize Virtualized Workloads  How to Modernize Virtualized Workloads
How to Modernize Virtualized Workloads
 
Microservice Development Using Telepresence
Microservice Development Using TelepresenceMicroservice Development Using Telepresence
Microservice Development Using Telepresence
 
Continuous Delivery to Kubernetes Using Helm
Continuous Delivery to Kubernetes Using HelmContinuous Delivery to Kubernetes Using Helm
Continuous Delivery to Kubernetes Using Helm
 
[Konveyor] adding security to dev ops for your kubernetes native applications
[Konveyor] adding security to dev ops for your kubernetes native applications [Konveyor] adding security to dev ops for your kubernetes native applications
[Konveyor] adding security to dev ops for your kubernetes native applications
 
Thinking One Step Further with Time-saving DevOps Tools with Open Telekom Clo...
Thinking One Step Further with Time-saving DevOps Tools with Open Telekom Clo...Thinking One Step Further with Time-saving DevOps Tools with Open Telekom Clo...
Thinking One Step Further with Time-saving DevOps Tools with Open Telekom Clo...
 
Docker 1.5 features - South Bay Microservices meetup March 2015
Docker 1.5 features - South Bay Microservices meetup March 2015Docker 1.5 features - South Bay Microservices meetup March 2015
Docker 1.5 features - South Bay Microservices meetup March 2015
 
Versioning in Pipeline Pilot - Pipeline Pilot Forum 2018
Versioning in Pipeline Pilot - Pipeline Pilot Forum 2018Versioning in Pipeline Pilot - Pipeline Pilot Forum 2018
Versioning in Pipeline Pilot - Pipeline Pilot Forum 2018
 
From development to production: Deploying Java and Scala apps to kubernetes
From development to production: Deploying Java and Scala apps to kubernetesFrom development to production: Deploying Java and Scala apps to kubernetes
From development to production: Deploying Java and Scala apps to kubernetes
 
Dr. Strangeconfig or: How I Learned to Stop Using Chef and Puppet and Love th...
Dr. Strangeconfig or: How I Learned to Stop Using Chef and Puppet and Love th...Dr. Strangeconfig or: How I Learned to Stop Using Chef and Puppet and Love th...
Dr. Strangeconfig or: How I Learned to Stop Using Chef and Puppet and Love th...
 
Migrating Java JBoss EAP Applications to Kubernetes With S2I
Migrating Java JBoss EAP Applications to Kubernetes With S2IMigrating Java JBoss EAP Applications to Kubernetes With S2I
Migrating Java JBoss EAP Applications to Kubernetes With S2I
 
Cost Control and Rapid Innovation in Kubernetes with OpenRewrite
Cost Control and Rapid Innovation in Kubernetes with OpenRewriteCost Control and Rapid Innovation in Kubernetes with OpenRewrite
Cost Control and Rapid Innovation in Kubernetes with OpenRewrite
 
Kubernetes buildpacks - from a source code to the running OCI container with ...
Kubernetes buildpacks - from a source code to the running OCI container with ...Kubernetes buildpacks - from a source code to the running OCI container with ...
Kubernetes buildpacks - from a source code to the running OCI container with ...
 
A mini adventure in Minikube devopsdays CT 2017
A mini adventure in Minikube devopsdays CT 2017A mini adventure in Minikube devopsdays CT 2017
A mini adventure in Minikube devopsdays CT 2017
 
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
Paris Container Day 2016 : Deep dive dc-os ci-cd (Mesosphere & Container Solu...
 
An Introduction to Docker
An Introduction to DockerAn Introduction to Docker
An Introduction to Docker
 
Cicd pixelfederation
Cicd pixelfederationCicd pixelfederation
Cicd pixelfederation
 
Containers and Orchestration approaches
Containers and Orchestration approachesContainers and Orchestration approaches
Containers and Orchestration approaches
 

Similar to Why You Should be Using Multi-stage Docker Builds in 2019

Docker based-pipelines
Docker based-pipelinesDocker based-pipelines
Docker based-pipelinesDevOps.com
 
Docker based-Pipelines with Codefresh
Docker based-Pipelines with CodefreshDocker based-Pipelines with Codefresh
Docker based-Pipelines with CodefreshCodefresh
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday developmentJustyna Ilczuk
 
Docker Timisoara: Dockercon19 recap slides, 23 may 2019
Docker Timisoara: Dockercon19 recap slides, 23 may 2019Docker Timisoara: Dockercon19 recap slides, 23 may 2019
Docker Timisoara: Dockercon19 recap slides, 23 may 2019Radulescu Adina-Valentina
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'acorehard_by
 
A Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and ContainersA Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and ContainersDocker, Inc.
 
Build and run applications in a dockerless kubernetes world
Build and run applications in a dockerless kubernetes worldBuild and run applications in a dockerless kubernetes world
Build and run applications in a dockerless kubernetes worldJorge Morales
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker composeLinkMe Srl
 
AllTheTalks 2020: Buildpacks - container for everyone!
AllTheTalks 2020: Buildpacks - container for everyone!AllTheTalks 2020: Buildpacks - container for everyone!
AllTheTalks 2020: Buildpacks - container for everyone!Zander Mackie
 
Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker ComposePrabhas Gupte
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and ContainersDocker, Inc.
 
Boston Ruby Group - Devops Pipeline
Boston Ruby Group - Devops Pipeline Boston Ruby Group - Devops Pipeline
Boston Ruby Group - Devops Pipeline Michael Durrant
 
Docker for local development
Docker for local developmentDocker for local development
Docker for local developmentAdam Štipák
 
VM vs Docker-Based Pipelines
VM vs Docker-Based PipelinesVM vs Docker-Based Pipelines
VM vs Docker-Based PipelinesCodefresh
 
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build TimesUsing Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build TimesDevOps.com
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and YouBalaBit
 
Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!Milindu Sanoj Kumarage
 
Perspectives on Docker
Perspectives on DockerPerspectives on Docker
Perspectives on DockerRightScale
 
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
 
Getting started with docker (2017)
Getting started with docker (2017)Getting started with docker (2017)
Getting started with docker (2017)JEMLI Fathi
 

Similar to Why You Should be Using Multi-stage Docker Builds in 2019 (20)

Docker based-pipelines
Docker based-pipelinesDocker based-pipelines
Docker based-pipelines
 
Docker based-Pipelines with Codefresh
Docker based-Pipelines with CodefreshDocker based-Pipelines with Codefresh
Docker based-Pipelines with Codefresh
 
Docker in everyday development
Docker in everyday developmentDocker in everyday development
Docker in everyday development
 
Docker Timisoara: Dockercon19 recap slides, 23 may 2019
Docker Timisoara: Dockercon19 recap slides, 23 may 2019Docker Timisoara: Dockercon19 recap slides, 23 may 2019
Docker Timisoara: Dockercon19 recap slides, 23 may 2019
 
Настройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'aНастройка окружения для кросскомпиляции проектов на основе docker'a
Настройка окружения для кросскомпиляции проектов на основе docker'a
 
A Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and ContainersA Gentle Introduction to Docker and Containers
A Gentle Introduction to Docker and Containers
 
Build and run applications in a dockerless kubernetes world
Build and run applications in a dockerless kubernetes worldBuild and run applications in a dockerless kubernetes world
Build and run applications in a dockerless kubernetes world
 
Adventures in docker compose
Adventures in docker composeAdventures in docker compose
Adventures in docker compose
 
AllTheTalks 2020: Buildpacks - container for everyone!
AllTheTalks 2020: Buildpacks - container for everyone!AllTheTalks 2020: Buildpacks - container for everyone!
AllTheTalks 2020: Buildpacks - container for everyone!
 
Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker Compose
 
Introduction to Docker and Containers
Introduction to Docker and ContainersIntroduction to Docker and Containers
Introduction to Docker and Containers
 
Boston Ruby Group - Devops Pipeline
Boston Ruby Group - Devops Pipeline Boston Ruby Group - Devops Pipeline
Boston Ruby Group - Devops Pipeline
 
Docker for local development
Docker for local developmentDocker for local development
Docker for local development
 
VM vs Docker-Based Pipelines
VM vs Docker-Based PipelinesVM vs Docker-Based Pipelines
VM vs Docker-Based Pipelines
 
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build TimesUsing Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
Using Multi-stage Docker, Go, Java,& Bazel to DESTROY Long Build Times
 
DevAssistant, Docker and You
DevAssistant, Docker and YouDevAssistant, Docker and You
DevAssistant, Docker and You
 
Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!Multi-stage Docker builds to make building easy!
Multi-stage Docker builds to make building easy!
 
Perspectives on Docker
Perspectives on DockerPerspectives on Docker
Perspectives on Docker
 
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
 
Getting started with docker (2017)
Getting started with docker (2017)Getting started with docker (2017)
Getting started with docker (2017)
 

More from Codefresh

Detect, debug, deploy with Codefresh and Lightstep
Detect, debug, deploy with Codefresh and LightstepDetect, debug, deploy with Codefresh and Lightstep
Detect, debug, deploy with Codefresh and LightstepCodefresh
 
Simplify Your Code with Helmfile
Simplify Your Code with HelmfileSimplify Your Code with Helmfile
Simplify Your Code with HelmfileCodefresh
 
5 Simple Tips for Troubleshooting Your Kubernetes Pods
5 Simple Tips for Troubleshooting Your Kubernetes Pods5 Simple Tips for Troubleshooting Your Kubernetes Pods
5 Simple Tips for Troubleshooting Your Kubernetes PodsCodefresh
 
Deploy Secure Cloud-Native Apps Fast
Deploy Secure Cloud-Native Apps Fast Deploy Secure Cloud-Native Apps Fast
Deploy Secure Cloud-Native Apps Fast Codefresh
 
Codefresh CICD New Features Launch! May 2019
Codefresh CICD New Features Launch! May 2019Codefresh CICD New Features Launch! May 2019
Codefresh CICD New Features Launch! May 2019Codefresh
 
Terraform GitOps on Codefresh
Terraform GitOps on CodefreshTerraform GitOps on Codefresh
Terraform GitOps on CodefreshCodefresh
 
Adding Container Image Scanning to Your Codefresh Pipelines with Anchore
Adding Container Image Scanning to Your Codefresh Pipelines with AnchoreAdding Container Image Scanning to Your Codefresh Pipelines with Anchore
Adding Container Image Scanning to Your Codefresh Pipelines with AnchoreCodefresh
 
Image scanning using Clair
Image scanning using Clair Image scanning using Clair
Image scanning using Clair Codefresh
 
Updating Kubernetes With Helm Charts: Build, Test, Deploy with Codefresh and...
 Updating Kubernetes With Helm Charts: Build, Test, Deploy with Codefresh and... Updating Kubernetes With Helm Charts: Build, Test, Deploy with Codefresh and...
Updating Kubernetes With Helm Charts: Build, Test, Deploy with Codefresh and...Codefresh
 
Automated Serverless Pipelines with #GitOps on Codefresh
Automated Serverless Pipelines with #GitOps on CodefreshAutomated Serverless Pipelines with #GitOps on Codefresh
Automated Serverless Pipelines with #GitOps on CodefreshCodefresh
 
Discovering and Fixing Dependency Vulnerabilities for Kubernetes apps with Sn...
Discovering and Fixing Dependency Vulnerabilities for Kubernetes apps with Sn...Discovering and Fixing Dependency Vulnerabilities for Kubernetes apps with Sn...
Discovering and Fixing Dependency Vulnerabilities for Kubernetes apps with Sn...Codefresh
 
Net Pipeline on Windows Kubernetes
Net Pipeline on Windows KubernetesNet Pipeline on Windows Kubernetes
Net Pipeline on Windows KubernetesCodefresh
 
Multi-cloud CI/CD with failover powered by K8s, Istio, Helm, and Codefresh
Multi-cloud CI/CD with failover powered by K8s, Istio, Helm, and Codefresh Multi-cloud CI/CD with failover powered by K8s, Istio, Helm, and Codefresh
Multi-cloud CI/CD with failover powered by K8s, Istio, Helm, and Codefresh Codefresh
 
Skip Staging! Test Docker, Helm, and Kubernetes Apps like a Pro
Skip Staging! Test Docker, Helm, and Kubernetes Apps like a ProSkip Staging! Test Docker, Helm, and Kubernetes Apps like a Pro
Skip Staging! Test Docker, Helm, and Kubernetes Apps like a ProCodefresh
 
Istio + Helm + Canary Webinar
Istio + Helm + Canary WebinarIstio + Helm + Canary Webinar
Istio + Helm + Canary WebinarCodefresh
 
Selenium Testing your Kubernetes Apps with Machine Learning and Testim
Selenium Testing your Kubernetes Apps with Machine Learning and TestimSelenium Testing your Kubernetes Apps with Machine Learning and Testim
Selenium Testing your Kubernetes Apps with Machine Learning and TestimCodefresh
 
Continuous Delivery for Kubernetes Apps with Helm and ChartMuseum
Continuous Delivery for Kubernetes Apps with Helm and ChartMuseumContinuous Delivery for Kubernetes Apps with Helm and ChartMuseum
Continuous Delivery for Kubernetes Apps with Helm and ChartMuseumCodefresh
 
New Features Webinar-April
New Features Webinar-AprilNew Features Webinar-April
New Features Webinar-AprilCodefresh
 
Continuous Delivery of Stateful Applications with Kubernetes (in Production)
Continuous Delivery of Stateful Applications with Kubernetes (in Production)Continuous Delivery of Stateful Applications with Kubernetes (in Production)
Continuous Delivery of Stateful Applications with Kubernetes (in Production)Codefresh
 
5 Habits of High-Velocity Teams Using Kubernetes
5 Habits of High-Velocity Teams Using Kubernetes5 Habits of High-Velocity Teams Using Kubernetes
5 Habits of High-Velocity Teams Using KubernetesCodefresh
 

More from Codefresh (20)

Detect, debug, deploy with Codefresh and Lightstep
Detect, debug, deploy with Codefresh and LightstepDetect, debug, deploy with Codefresh and Lightstep
Detect, debug, deploy with Codefresh and Lightstep
 
Simplify Your Code with Helmfile
Simplify Your Code with HelmfileSimplify Your Code with Helmfile
Simplify Your Code with Helmfile
 
5 Simple Tips for Troubleshooting Your Kubernetes Pods
5 Simple Tips for Troubleshooting Your Kubernetes Pods5 Simple Tips for Troubleshooting Your Kubernetes Pods
5 Simple Tips for Troubleshooting Your Kubernetes Pods
 
Deploy Secure Cloud-Native Apps Fast
Deploy Secure Cloud-Native Apps Fast Deploy Secure Cloud-Native Apps Fast
Deploy Secure Cloud-Native Apps Fast
 
Codefresh CICD New Features Launch! May 2019
Codefresh CICD New Features Launch! May 2019Codefresh CICD New Features Launch! May 2019
Codefresh CICD New Features Launch! May 2019
 
Terraform GitOps on Codefresh
Terraform GitOps on CodefreshTerraform GitOps on Codefresh
Terraform GitOps on Codefresh
 
Adding Container Image Scanning to Your Codefresh Pipelines with Anchore
Adding Container Image Scanning to Your Codefresh Pipelines with AnchoreAdding Container Image Scanning to Your Codefresh Pipelines with Anchore
Adding Container Image Scanning to Your Codefresh Pipelines with Anchore
 
Image scanning using Clair
Image scanning using Clair Image scanning using Clair
Image scanning using Clair
 
Updating Kubernetes With Helm Charts: Build, Test, Deploy with Codefresh and...
 Updating Kubernetes With Helm Charts: Build, Test, Deploy with Codefresh and... Updating Kubernetes With Helm Charts: Build, Test, Deploy with Codefresh and...
Updating Kubernetes With Helm Charts: Build, Test, Deploy with Codefresh and...
 
Automated Serverless Pipelines with #GitOps on Codefresh
Automated Serverless Pipelines with #GitOps on CodefreshAutomated Serverless Pipelines with #GitOps on Codefresh
Automated Serverless Pipelines with #GitOps on Codefresh
 
Discovering and Fixing Dependency Vulnerabilities for Kubernetes apps with Sn...
Discovering and Fixing Dependency Vulnerabilities for Kubernetes apps with Sn...Discovering and Fixing Dependency Vulnerabilities for Kubernetes apps with Sn...
Discovering and Fixing Dependency Vulnerabilities for Kubernetes apps with Sn...
 
Net Pipeline on Windows Kubernetes
Net Pipeline on Windows KubernetesNet Pipeline on Windows Kubernetes
Net Pipeline on Windows Kubernetes
 
Multi-cloud CI/CD with failover powered by K8s, Istio, Helm, and Codefresh
Multi-cloud CI/CD with failover powered by K8s, Istio, Helm, and Codefresh Multi-cloud CI/CD with failover powered by K8s, Istio, Helm, and Codefresh
Multi-cloud CI/CD with failover powered by K8s, Istio, Helm, and Codefresh
 
Skip Staging! Test Docker, Helm, and Kubernetes Apps like a Pro
Skip Staging! Test Docker, Helm, and Kubernetes Apps like a ProSkip Staging! Test Docker, Helm, and Kubernetes Apps like a Pro
Skip Staging! Test Docker, Helm, and Kubernetes Apps like a Pro
 
Istio + Helm + Canary Webinar
Istio + Helm + Canary WebinarIstio + Helm + Canary Webinar
Istio + Helm + Canary Webinar
 
Selenium Testing your Kubernetes Apps with Machine Learning and Testim
Selenium Testing your Kubernetes Apps with Machine Learning and TestimSelenium Testing your Kubernetes Apps with Machine Learning and Testim
Selenium Testing your Kubernetes Apps with Machine Learning and Testim
 
Continuous Delivery for Kubernetes Apps with Helm and ChartMuseum
Continuous Delivery for Kubernetes Apps with Helm and ChartMuseumContinuous Delivery for Kubernetes Apps with Helm and ChartMuseum
Continuous Delivery for Kubernetes Apps with Helm and ChartMuseum
 
New Features Webinar-April
New Features Webinar-AprilNew Features Webinar-April
New Features Webinar-April
 
Continuous Delivery of Stateful Applications with Kubernetes (in Production)
Continuous Delivery of Stateful Applications with Kubernetes (in Production)Continuous Delivery of Stateful Applications with Kubernetes (in Production)
Continuous Delivery of Stateful Applications with Kubernetes (in Production)
 
5 Habits of High-Velocity Teams Using Kubernetes
5 Habits of High-Velocity Teams Using Kubernetes5 Habits of High-Velocity Teams Using Kubernetes
5 Habits of High-Velocity Teams Using Kubernetes
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 

Why You Should be Using Multi-stage Docker Builds in 2019

  • 1. Why you should be using Multi-Stage Docker Builds in 2019 GUY SALTON
  • 3. Agenda ● The problem with Docker build ● Solution: Docker multi-stage build ● Docker multi-stage build in CI/CD ● Summary ● Dockerfile and Docker build https://github.com/codefresh-contrib/golang-sample-app/ https://codefresh.io/docs/docs/learn-by-example/golang/golang-hello-world/
  • 4. Docker multi-stage build ● “oh man! thank you! I've been fighting with build times on an image stack for weeks” ● “Wow, this is great for deploying tonnes of microservices!” ● “I've been meaning to use multistage builds, thanks for the walkthrough!” https://www.reddit.com/r/golang/comments/crkibq/docker_golang_reducing_container_size_using/ Multi-stage build is available starting from Docker 17.05 (released in 2017!) - so why now?
  • 5. Dockerfile and 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
  • 7. Demo 1: Docker build on GO app https://github.com/codefresh-contrib/helm-sample-app
  • 8. The Problem with Docker build Image we want Image we build runtime configuration application Compilers, debuggers, ... Linters, tests, profilers, ... code, build and test logs, ... runtime configuration application X (4..10)
  • 9. The Problem with Docker build ● 2 Dockerfiles ○ 1st for build tools ○ 2nd for runtime ● Drawbacks ○ 2+ Dockerfiles ○ Orchestration needed: Bash, make, YAML, ...
  • 10. Solution: Docker multi-stage build ● Benefits ○ One Dockerfile ○ One syntax to learn ○ Same build ■ Local and CI ○ Create multiple stages
  • 13. Docker multi-stage build You can enjoy multi-stage build with every programming language (not only GO): ● GO example - https://codefresh.io/docs/docs/learn-by-example/golang/golang-hello-world/#create-a-multi-stage-docker-image-for-go ● JAVA example - https://codefresh.io/docs/docs/learn-by-example/java/spring-boot-2/#spring-boot-2-and-docker-multi-stage-builds ● Node example - https://codefresh.io/docs/docs/learn-by-example/nodejs/react/#react-and-docker-multi-stage-builds ● PHP example - https://codefresh.io/docs/docs/learn-by-example/php/#the-example-php-project https://codefresh.io/containers/docker-anti-patterns/Docker anti-patterns
  • 14. Codefresh The 1st container-native CI/CD Platform for Microservices Container-native Intuitive & Robust Enterprise Ready Flexible Delivery
  • 15. Demo 3: Docker multi-stage build in CI/CD
  • 16. Summary ● Using 1 Docker image for both build and production results in slow deployment and lots of CVE violations ● Multi-stage build to produce lean, secure and production ready Docker image ● On Codefresh, speedier builds thanks to caching across all images and layers
  • 17. Signup for a FREE account with UNLIMITED builds & schedule a 1:1 with our experts at https://codefresh.io Build Fast, Deploy Faster Thank You! guy.salton@codefresh.io