Closed philvarner closed 8 months ago
To be honest, I don't think we should use the image as a runtime but more as a mean to create lambda package or layer. gcc can be useful when you need to install complex python library which require C code 🤷
Ah! I understand what you mean now. I only now got back around to working on what I was originally doing with this, and using that image as a lambda base image did not work -- which is to be expected, since it's not configured to be one.
I'll still submit a pr for the image cleanup commands.
The Dockerfile directive
RUN yum install -y gcc gcc-c++
in https://github.com/lambgeo/docker-lambda/blob/master/dockerfiles/runtimes/python adds 500MB to the image, but is unused at runtime.A more efficient approach would be to use a multi-stage build and copy only the files that are necessary for runtime into the resulting image.
Additionally and/or alternatively,
&& yum clean all && rm -rf /var/cache/yum /var/lib/yum/history
can be added to the command to reduce the size of the layer.