Skip to content

fix(docker): pin base image versions for reproducible builds - #3789

Open
JasonWH wants to merge 1 commit into
openimsdk:3.8.3-patchfrom
JasonWH:fix/dockerfile-pin-base-images
Open

fix(docker): pin base image versions for reproducible builds#3789
JasonWH wants to merge 1 commit into
openimsdk:3.8.3-patchfrom
JasonWH:fix/dockerfile-pin-base-images

Conversation

@JasonWH

@JasonWH JasonWH commented Aug 24, 2026

Copy link
Copy Markdown

Problem

The Dockerfile relies on floating image tags — golang:alpine for the build stage and alpine:latest for the runtime stage. This causes:

  1. Non-reproducible builds — the same commit can build against a different Go toolchain or base image depending on when it's built.
  2. Drift from go.modgo.mod declares go 1.25.0, but golang:alpine tracks the latest stable Go, which can move past 1.25 and trigger toolchain downloads or subtle behavior changes.
  3. Supply-chain risk — floating tags (especially :latest) are a common vector for tag-replay/mutability attacks.

Changes

Stage Before After
builder golang:alpine golang:1.25-alpine
runtime alpine:latest alpine:3.23

Rationale

  • golang:1.25-alpine aligns the build toolchain with the go 1.25.0 declared in go.mod, keeping builds deterministic and reproducible.
  • alpine:3.23 is the current stable Alpine series. Pinning the minor (rather than latest) still receives security patches within the series while preventing unexpected jumps to a new minor.

Notes

  • This is an improvement, not a bugfix: the current image builds successfully, but the floating tags make the result non-reproducible.
  • No functional or code changes; only base-image tags are pinned.

- golang:alpine → golang:1.25-alpine (align with go.mod's go 1.25.0)
- alpine:latest → alpine:3.23 (pin runtime base image)

Floating tags make builds non-reproducible and can drift from the
Go version declared in go.mod. Pinning both stages keeps builds
deterministic and reduces supply-chain risk.
@pull-request-size pull-request-size Bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Aug 24, 2026
@github-actions

github-actions Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

🤖 All Contributors have signed the CLA.
The signed information is recorded here
Posted by the CLA Assistant Lite bot.

@JasonWH

JasonWH commented Aug 26, 2026

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

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

Labels

size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant