Multi-stage builds are a new feature requiring Docker ≥ 17.05
Bhanja Kishore Biswal
Solution Architect at Infosys ,managing Devops,CI/CD, BigData,SnowFlake and AWS Cloud based applications, passionate in AI ,Deep learning
Use multi-stage builds
With multi-stage builds, you use multiple FROM statements in your Dockerfile. Each FROM instruction can use a different base, and each of them begins a new stage of the build. You can selectively copy artifacts from one stage to another, leaving behind everything you don't want in the final image.