cloud-code-samples icon indicating copy to clipboard operation
cloud-code-samples copied to clipboard

The python, node, and go Dockerfiles should use multi-stage builds

Open jonjohnsonjr opened this issue 6 years ago • 2 comments

The hello-world for go produces a 346 MB image right now. Switching over to use gcr.io/distroless/base cuts that down to 19.8MB. We could probably cut that down further with gcr.io/distroless/static and static compilation, but that makes using delve a bit of a pain.

Similarly, the node and python examples both use a 300MB+ base image without using a multi-stage build to cut down the size of the resulting image.

jonjohnsonjr avatar Sep 30 '19 19:09 jonjohnsonjr

It is not typical to use multi-stage images with Python and Node, though some could be used. Cloud Run samples use debian slim images to minimize the size.

grayside avatar Jun 23 '20 20:06 grayside

Node and Python have since been moved over to Alpine. (Go was not moved due to test failures.)

@jonjohnsonjr does that address your concerns here?

ace-n avatar Aug 25 '22 18:08 ace-n

Closing due to no response after over 1 year.

grayside avatar Nov 15 '23 00:11 grayside