Open timburks opened 6 months ago
The actual impact of the images being so large, is that it makes the cold start time in Google Cloud Run for the espv2 containers about ~1.5s.
You can do it yourself with this Dockerfile:
FROM gcr.io/endpoints-release/endpoints-runtime-serverless:2 as strip
USER root
RUN apk update && apk add binutils
RUN strip /bin/envoy
FROM scratch
COPY --from=strip / /
ENV ENDPOINTS_SERVICE_PATH /etc/endpoints/service.json
COPY service.json ${ENDPOINTS_SERVICE_PATH}
RUN chown -R envoy:envoy ${ENDPOINTS_SERVICE_PATH} && chmod -R 755 ${ENDPOINTS_SERVICE_PATH}
USER envoy
ENV ESPv2_ARGS ^++^--cors_preset=basic
ENTRYPOINT ["/env_start_proxy.py"]
This will generate a version which is ~180Mb in size and still works on Google Cloud Run.
I tested the latency on Google Cloud Run, seems like I'm still getting the same latencies, so I guess it's not that big of an issue. I was wrong!
I noticed that the ESPv2 containers are much larger than the ones for ESPv1:
Nearly all of this is due to the envoy binary:
As a test, I ran
strip
on the envoy binary and the result was much smaller.What do you think about adding
strip
to the official build process?