Repository navigation
Download apk.static from Alpine package repository - #17523
Conversation
Preserve the existing verified download path while allowing callers to provide a pre-acquired apk.static executable. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The Alpine download path can still fail unexpectedly on unrecognized host architectures because it warns but then runs checksum validation with an unset hash.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the eng/common/cross/build-rootfs.sh Alpine rootfs flow to support using a locally provided apk.static binary, avoiding network downloads that can fail in restricted environments (e.g., official pipelines with blocked URIs).
Changes:
- Add
--apk-static <path>option to accept a localapk.staticexecutable. - Update Alpine rootfs setup to copy
apk.staticfrom the provided path instead of downloading it when the option is used.
File summaries
| File | Description |
|---|---|
| eng/common/cross/build-rootfs.sh | Adds --apk-static flag and updates Alpine apk.static acquisition logic to support local usage. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
if I understood the docker prereqs PR correctly you're just switching to a different URL right? why not just make that switch here too? |
no, instead of getting the public key from the web, we'll just store it in the repo and pass the local path to it here. We do that for some other keys too |
|
@dkurepa but apk.static is not a public key, it's a 3MB static executable? |
|
basically what I'm saying is that we should just fetch https://dl-cdn.alpinelinux.org/alpine/v3.20/main/x86_64/apk-tools-static-2.14.4-r1.apk here instead of the version from gitlab (and we could decide to mirror that in our blob storage even) |
Download and verify apk-tools-static from the configured Alpine repository, while retaining the pinned standalone GitLab binary as a download fallback. Co-authored-by: Copilot <[email protected]>
Remove the legacy standalone download fallback and use the pinned official apk-tools-static package as the single source. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The updated Alpine bootstrap currently hard-codes an Alpine repo version, fails confusingly on unsupported host architectures, and the .apk extraction logic is likely incorrect for typical Alpine package structure.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (2)
eng/common/cross/build-rootfs.sh:556
- For host architectures other than
x86_64/aarch64, the script only prints a warning but still runssha512sum -cwith an unset hash, which will fail underset -eanyway. Consider failing fast with a clear error (or skipping verification) to avoid a confusing checksum error.
else
echo "WARNING: add missing hash for your host architecture. To find the value, use: 'find /tmp -name apk-tools-static.apk -exec sha512sum {} \;'"
fi
echo "$__ApkToolsSHA512SUM $__ApkToolsDir/apk-tools-static.apk" | sha512sum -c
eng/common/cross/build-rootfs.sh:557
apk-tools-static-*.apkis an Alpine package; theapk.staticbinary is stored inside the package payload (data.tar.*), not as a top-levelsbin/apk.staticentry in the outer archive. Extractingsbin/apk.staticdirectly from the.apkis likely to fail and stop the script (set -e).
tar -xzf "$__ApkToolsDir/apk-tools-static.apk" -C "$__ApkToolsDir" --strip-components=1 sbin/apk.static
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
right, I got a bit confused with the changes because there are two issues. I'll push a fix that just changes where we get the |
Use the same pinned package acquisition and verification validated by the prereqs Docker pipeline. Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The changes are narrowly scoped, include integrity verification, and the updated flow cleanly replaces the previously blocked download without introducing apparent behavioral regressions in the script logic.
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0 new
- Review effort level: Lite
Summary
gitlab.alpinelinux.orgdownload of the standaloneapk.staticbinaryapk-tools-static2.14.4-r1 from Alpine's official CDN and extractsbin/apk.staticValidation
Fixes the
apk.staticNetwork Isolation failure from prereqs Docker official build 3062691.