lightbend / cloudflow

Cloudflow enables users to quickly develop, orchestrate, and operate distributed streaming applications on Kubernetes.
https://cloudflow.io
Apache License 2.0
321 stars 89 forks source link

[proposal] Use Docker multistage to build Streamlet Docker images #954

Open andreaTP opened 3 years ago

andreaTP commented 3 years ago

Currently, we build the entire Streamlet Docker image in the same Dockerfile ( ref ).

This is sub-optimal in regards to caching and "final image size".

To improve this aspect we can use a Docker Multistage build that prepares all of the fundamental artifacts/building blocks in one image and simply copy the results to the actual image that will run the Streamlet.

This will improve as well the separation of concerns, creates much fewer layers in the resulting image, and is very likely to help trim the size of the final image.

leozilla commented 3 years ago

Very much agree here. This also allows to use a minimal base image in the final image.