Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save redlinejoes/3c2faea1830b74376d73991d4bcab764 to your computer and use it in GitHub Desktop.
Save redlinejoes/3c2faea1830b74376d73991d4bcab764 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