What would you like to be added:
Reduce the attack surface of the codegen Docker image while maintaining compatibility with protoc and mockgen.
The current codegen image (tool/codegen/Dockerfile) uses golang:1.25.2 as the base image.
#6402 triedto use debian:bookworm-slim to reduce the image size and address curl-related CVEs, but was reverted in #6404 due to:
- Missing
google/protobuf/*.proto files required by protoc
- mockgen requiring
go command at runtime
Why is this needed:
- Address CVEs flagged by Snyk
- Reduce unnecessary dependencies in the codegen image
Possible approaches:
- Separate protoc and mockgen into different stages or images
(I think just bumping Go or remove some dependencies are just hack)
ref. #6402, #6404