Repository navigation
Multi-arch container publishing - #3875
Hans Bakker (hansmbakker) wants to merge 1 commit into
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
|
Here is a suggested contribution for multi-arch container image builds intending to fix #3854. Since there was no existing container image publishing pipeline I could not build upon that. I'd like to ask the maintainers of this repo to take it from here, as this is a process they should be owner of. |
There was a problem hiding this comment.
🔵 Needs a closer look
Native ARM64 execution and registry publishing remain unvalidated, and the new CI matrix still needs to pass.
No open issues 🎉
What changed in this PR
Prepares DAB containers for Linux AMD64 and ARM64 while preserving root and non-root variants. Official MCR publishing still requires external release-pipeline changes.
Changes:
- Publish framework-dependent application output for the requested container architecture.
- Add multi-platform publishing and native architecture CI checks.
- Document build and release steps, and exclude local artifacts and environment files from the build context.
| File | Description |
|---|---|
scripts/publish-container.sh |
Pushes both architectures under each supplied tag. |
README.md |
Links to container build and publishing guidance. |
Dockerfile |
Uses the native SDK to publish for the target architecture. |
docker/README.md |
Documents local builds, publishing, and index-preserving MCR promotion. |
.github/workflows/container-build.yml |
Adds native AMD64 and ARM64 checks for both runtime variants. |
.dockerignore |
Excludes Git metadata, build artifacts, and root environment files. |
Review effort: Balanced
Why make this change?
What is this change?
How was this tested?
Validation performed against the session changes (the pushed patch contains the same six changed files):
bash -n scripts/publish-container.sh— passed.git diff --check— passed before committing.docker buildx build --builder dab-multiarch --platform linux/amd64,linux/arm64 --target runtime --output type=oci,dest=/root/.copilot/session-state/e576fd408b1c412fbfcf67dc261ba454/files/dab-runtime.oci.tar --progress plain .— failed because the environment's NuGet TLS certificate chain was untrusted inside the build container.docker buildx build --builder dab-multiarch --file /root/.copilot/session-state/e576fd408b1c412fbfcf67dc261ba454/files/Validation.Dockerfile --secret id=ca-bundle,src=/etc/ssl/certs/ca-certificates.crt --platform linux/amd64,linux/arm64 --target runtime --output type=oci,dest=/root/.copilot/session-state/e576fd408b1c412fbfcf67dc261ba454/files/dab-runtime.oci.tar --progress plain .— passed. The equivalent command with--target runtime-nonrootand a separate output archive also passed, using emulation for the ARM64 permissions step. No certificate changes are included in this PR.python /root/.copilot/session-state/e576fd408b1c412fbfcf67dc261ba454/files/verify-oci.py /root/.copilot/session-state/e576fd408b1c412fbfcf67dc261ba454/files/dab-runtime.oci.tar /root/.copilot/session-state/e576fd408b1c412fbfcf67dc261ba454/files/dab-nonroot.oci.tar— passed: both archives contain amd64 and arm64 platform manifests; application RIDs and runtime ELF architectures match each platform./api/Bookagainst an isolated PostgreSQL database and verified the expected row. Non-root UID and writable/App/logschecks passed.Sample Request(s)