From Docker 17.05, Dockerfile can contains two or more FROM statements. Each FROM statements make new fresh stages, and can fetch build artifacts from previous named stages. We can make smaller images by removing build dependencies including only runtime dependencies in final stage.
docs: https://docs.docker.com/develop/develop-images/multistage-build/