Last updated
Last updated
In this lesson, we will learn how to build smaller images using multi-stage builds.
By default, the stages are not named Stages are numbered with integers Starting with 0 for the first FROM instruction Name the stage by adding as to the FROM instruction Reference the stage name in the COPY instruction
Step 1: Set up your environment:
Step 2: Create the Dockerfile:
Step 3: Create an image for the weather-app using multi-stage build
Dockerfile contents:
Step 4: Create an image for the weather-app using multi-stage build
Step 5: List images to see the size difference:
Step 6: Create the weather-app container: