[ubuntu] Fail fast on Docker plugin/host architecture mismatch and scope Packer -only to the exact build#14324
Open
v-GeorgyPuzakov wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request hardens Ubuntu image generation by preventing silent creation of broken images when the Docker engine/plugin architectures don’t match, and by ensuring CI Packer builds target only the intended build(s) when templates share a directory.
Changes:
- Added a fail-fast guard in
install-docker.shto abort when the Docker CLI plugin asset architecture (from toolset) doesn’t match the host-detecteddocker_arch, avoiding runtimeexec format error. - Scoped Packer
-onlyselection inimages.CI/linux-and-win/build-image.ps1from a prefix glob ($buildName*) to a build-address glob ($buildName.*), preventing unintended selection of similarly-prefixed builds (e.g.,ubuntu-22_04also triggeringubuntu-22_04-arm64).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| images/ubuntu/scripts/build/install-docker.sh | Adds an explicit architecture compatibility check to fail early on Docker CLI plugin/host mismatches. |
| images.CI/linux-and-win/build-image.ps1 | Tightens Packer -only targeting to the intended build address pattern, avoiding accidental multi-build execution. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Bug fixing / hardening
On the Ubuntu Arm64 recipe,
docker-ceis installed for the machine-detected arch, but thebuildx/composeplugins use the arch hardcoded in the arm64 toolset (linux-arm64/linux-aarch64). When the arm64 recipe runs on an x86 VM you get an amd64 engine + arm64 plugins →exec format error,Tools.Tests.ps1fails and the build aborts with no artifacts.Trigger: #14113 put
build.ubuntu-22_04-arm64.pkr.hclin the sharedimages/ubuntu/templates/dir, so a prefix glob-only "ubuntu-22_04*"also runsubuntu-22_04-arm64— on the shared Intelvm_sizedefault.install-docker.shthen silently built a broken image instead of failing fast.Changes
install-docker.sh— fail-fast guard: error out if a Docker plugin's toolset asset arch doesn't match the host (docker_arch), instead of installing a plugin that can't run. No change for correctly matched builds.images.CI/linux-and-win/build-image.ps1—-only "$buildName.*"instead of-only "$buildName*", soubuntu-22_04no longer also triggersubuntu-22_04-arm64(matchesGenerateResourcesAndImage.ps1and the docs).Related issue:
Check list