Skip to content

ashishnxt/Docker-Multi-Stage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Method 1 : MULTI STAGE BUILD

Screenshot 2024-08-01 114042

Method 2 : DOCKER LAYER Reference : https://docs.docker.com/build/guide/layers/

image

Method 3 : SCRATCH IMAGE Reference : https://hub.docker.com/_/scratch/

image

Dockerfile Explanation

The multistage Dockerfile consists of two build stages, each optimized for a specific purpose.

Stage 1: Build the Flask Application

  • Use a Python base image to build the Flask backend.
  • Copy the backend source code and install dependencies.
  • Build the Flask application.

Stage 2: Final Image

  • Use a minimal Python base image for the final image.
  • Copy the built backend from Stage 1.
  • Expose the necessary port and start the Flask application.

About

Method to reduce the size of Docker image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published