Skip to content

Conversation

@Okabe-Junya
Copy link
Member

@Okabe-Junya Okabe-Junya commented Jan 5, 2026

What this PR does:

  • Change codegen Dockerfile base image from golang:1.25.2 to debian:bookworm-slim
  • Use multi-stage build to compile Go plugins in builder stage and copy only binaries to final image
  • Update Go version from 1.25.2 to 1.25.5
  • Remove wget and ca-certificates after use

Why we need it:

Which issue(s) this PR fixes:

cf. #6379 (review)

Does this PR introduce a user-facing change?:

  • How are users affected by this change:
  • Is this breaking change:
  • How to migrate (if breaking change):

Signed-off-by: Junya Okabe <junya.okabe.ig@gmail.com>
@Okabe-Junya Okabe-Junya self-assigned this Jan 5, 2026
@Okabe-Junya Okabe-Junya marked this pull request as ready for review January 5, 2026 16:58
@Okabe-Junya Okabe-Junya requested a review from a team as a code owner January 5, 2026 16:58
Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great improvement, thanks 👍

@khanhtc1202
Copy link
Member

Note: Try re-gen the new container image on CI after this been merged

@khanhtc1202 khanhtc1202 merged commit 60636fb into pipe-cd:master Jan 6, 2026
63 of 65 checks passed
@Okabe-Junya Okabe-Junya deleted the refactor-dockerfile branch January 6, 2026 05:05
@khanhtc1202
Copy link
Member

@Okabe-Junya Tested on my local and look like the built container image missed some protoc lib.

google/protobuf/descriptor.proto: File not found.
google/protobuf/duration.proto: File not found.
google/protobuf/timestamp.proto: File not found.
validate/validate.proto:7:1: Import "google/protobuf/descriptor.proto" was not found or had errors.
validate/validate.proto:8:1: Import "google/protobuf/duration.proto" was not found or had errors.
validate/validate.proto:9:1: Import "google/protobuf/timestamp.proto" was not found or had errors.
validate/validate.proto:798:14: "google.protobuf.Duration" is not defined.
validate/validate.proto:802:14: "google.protobuf.Duration" is not defined.
validate/validate.proto:806:14: "google.protobuf.Duration" is not defined.
validate/validate.proto:810:14: "google.protobuf.Duration" is not defined.
validate/validate.proto:814:14: "google.protobuf.Duration" is not defined.
validate/validate.proto:818:14: "google.protobuf.Duration" is not defined.
validate/validate.proto:822:14: "google.protobuf.Duration" is not defined.
validate/validate.proto:832:14: "google.protobuf.Timestamp" is not defined.
validate/validate.proto:836:14: "google.protobuf.Timestamp" is not defined.
validate/validate.proto:840:14: "google.protobuf.Timestamp" is not defined.
validate/validate.proto:844:14: "google.protobuf.Timestamp" is not defined.
validate/validate.proto:848:14: "google.protobuf.Timestamp" is not defined.
validate/validate.proto:861:14: "google.protobuf.Duration" is not defined.
validate/validate.proto:12:8: "google.protobuf.MessageOptions" is not defined.
validate/validate.proto: "google.protobuf.MessageOptions" is not defined.
validate/validate.proto:21:8: "google.protobuf.OneofOptions" is not defined.
validate/validate.proto:28:8: "google.protobuf.FieldOptions" is not defined.
pkg/model/analysis_result.proto:20:1: Import "validate/validate.proto" was not found or had errors.
make: *** [gen/code] Error 1

After I fixed the missing lib issue, it turned out we need to use the go command for mockgen 😓

- pkg/redis/redistest/redis.mock.go
generating mock...
2026/01/06 08:13:49 Loading input failed: load package: load packages: err: go command required, not found: exec: "go": executable file not found in $PATH: stderr: 
make: *** [gen/code] Error 1

So basically we need to use a Go container image for this codegen process (or have to find a way to separate protoc and mock into 2 different codegen images).

I will revert the commit till we find a way for better codegen image (as you pointed out)

khanhtc1202 added a commit that referenced this pull request Jan 6, 2026
khanhtc1202 added a commit that referenced this pull request Jan 6, 2026
This reverts commit 60636fb.

Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
khanhtc1202 added a commit that referenced this pull request Jan 6, 2026
This reverts commit 60636fb.

Signed-off-by: khanhtc1202 <khanhtc1202@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants