Skip to content

Improve codegen Docker image security without breaking protoc/mockgen #6429

Description

@Okabe-Junya

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:

  1. Missing google/protobuf/*.proto files required by protoc
  2. 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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions