Refresh Alpine base image package pins - #196
Conversation
WalkthroughThe base images now pin OpenSSL ChangesBase image refresh
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@infra/docker/base-images/Dockerfile.builder`:
- Line 40: Replace the live-index OpenSSL installation in
infra/docker/base-images/Dockerfile.builder at lines 40-40 with the existing
reproducible flow: resolve the architecture, download openssl-3.5.7-r0.apk,
verify it against its checksum, and install the verified package by path. Apply
the same change in infra/docker/base-images/Dockerfile.runtime at lines 33-33,
adding the corresponding runtime checksum entry.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 1edb895b-f401-4c03-809c-af4931855e5e
📒 Files selected for processing (6)
infra/docker/base-images/Dockerfile.builderinfra/docker/base-images/Dockerfile.runtimeinfra/docker/base-images/checksums/runtime-aarch64.sha256infra/docker/base-images/checksums/runtime-x86_64.sha256infra/docker/base-images/generate-checksums.shinfra/makefile/build.mk
| # provider name conflicts with the musl-provided headers already present). | ||
| # 6. Clean up all temporary artifacts. | ||
| RUN apk add --no-cache openssl=3.5.6-r0 && \ | ||
| RUN apk add --no-cache openssl=3.5.7-r0 && \ |
There was a problem hiding this comment.
🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift
The temporary OpenSSL package bypasses the reproducible package flow.
Both images install OpenSSL from the live APK index rather than downloading and verifying the exact artefact used for the build. This weakens the stated checksum and reproducibility guarantees.
infra/docker/base-images/Dockerfile.builder#L40-L40: resolve the architecture before installation, then fetch and checksum-verifyopenssl-3.5.7-r0.apkbefore installing it by path.infra/docker/base-images/Dockerfile.runtime#L33-L33: apply the same verified installation flow and add the corresponding runtime checksum entry.
🧰 Tools
🪛 Hadolint (2.14.0)
[warning] 40-40: Use WORKDIR to switch to a directory
(DL3003)
[warning] 40-40: Pin versions in apk add. Instead of apk add <package> use apk add <package>=<version>
(DL3018)
[info] 40-40: Double quote to prevent globbing and word splitting.
(SC2086)
[warning] 40-40: Set the SHELL option -o pipefail before RUN with a pipe in it. If you are using /bin/sh in an alpine image or if your shell is symlinked to busybox then consider explicitly setting your SHELL to /bin/ash, or disable this check
(DL4006)
🪛 Trivy (0.72.0)
[warning] 40-104: 'RUN cd ...' to change directory
RUN should not be used to change directory: 'apk add --no-cache openssl=3.5.7-r0 && target_arch="${TARGETARCH}"; if [ -z "${target_arch}" ]; then case "$(apk --print-arch)" in aarch64) target_arch="arm64" ;; x86_64) target_arch="amd64" ;; *) echo "Unsupported Alpine arch:
Rule: DS-0013
(IaC/Dockerfile)
📍 Affects 2 files
infra/docker/base-images/Dockerfile.builder#L40-L40(this comment)infra/docker/base-images/Dockerfile.runtime#L33-L33
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@infra/docker/base-images/Dockerfile.builder` at line 40, Replace the
live-index OpenSSL installation in infra/docker/base-images/Dockerfile.builder
at lines 40-40 with the existing reproducible flow: resolve the architecture,
download openssl-3.5.7-r0.apk, verify it against its checksum, and install the
verified package by path. Apply the same change in
infra/docker/base-images/Dockerfile.runtime at lines 33-33, adding the
corresponding runtime checksum entry.
Summary
Verification
make build-base-imagesmake generate-apk-checksumsgit diff --checkThis repairs the existing clean-runner failure before the writing redirect deployment.
Summary by CodeRabbit