Skip to content

Instantly share code, notes, and snippets.

@vfarcic
Last active July 19, 2023 03:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save vfarcic/da48772c54dcf09a45bef5d4d778a6e9 to your computer and use it in GitHub Desktop.
Save vfarcic/da48772c54dcf09a45bef5d4d778a6e9 to your computer and use it in GitHub Desktop.
# Source: https://gist.github.com/da48772c54dcf09a45bef5d4d778a6e9
###################################
# Using Docker Multi-Stage Builds #
# https://youtu.be/zpkqNPwEzac #
###################################
# Referenced videos:
# - Kaniko - Building Container Images In Kubernetes Without Docker: https://youtu.be/EgwVQN6GNJg
# - Skaffold - How to Build and Deploy In Kubernetes: https://youtu.be/qS_4Qf8owc0
#########
# Setup #
#########
git clone https://github.com/vfarcic/docker-multistage-demo.git
cd docker-multistage-demo
#####################
# Simple Dockerfile #
#####################
cat Dockerfile-simple
docker image build --tag demo \
--file Dockerfile-simple .
##################
# Fat Dockerfile #
##################
cat Dockerfile-fat
docker image build --tag demo \
--file Dockerfile-fat .
docker image build --tag demo \
--file Dockerfile-fat .
docker image list
#################################
# Multi-stage Dockerfile builds #
#################################
cat Dockerfile
docker image build --tag demo .
docker image list
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment