Skip to content

[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
actions:mainfrom
v-GeorgyPuzakov:14302arm64build
Open

[ubuntu] Fail fast on Docker plugin/host architecture mismatch and scope Packer -only to the exact build#14324
v-GeorgyPuzakov wants to merge 1 commit into
actions:mainfrom
v-GeorgyPuzakov:14302arm64build

Conversation

@v-GeorgyPuzakov

Copy link
Copy Markdown
Contributor

Description

Bug fixing / hardening

On the Ubuntu Arm64 recipe, docker-ce is installed for the machine-detected arch, but the buildx/compose plugins 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.ps1 fails and the build aborts with no artifacts.

Trigger: #14113 put build.ubuntu-22_04-arm64.pkr.hcl in the shared images/ubuntu/templates/ dir, so a prefix glob -only "ubuntu-22_04*" also runs ubuntu-22_04-arm64 — on the shared Intel vm_size default. install-docker.sh then silently built a broken image instead of failing fast.

Changes

  1. 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.
  2. images.CI/linux-and-win/build-image.ps1-only "$buildName.*" instead of -only "$buildName*", so ubuntu-22_04 no longer also triggers ubuntu-22_04-arm64 (matches GenerateResourcesAndImage.ps1 and the docs).

Related issue:

Check list

  • Related issue / work item is attached
  • Tests are written (if applicable)
  • Documentation is updated (if applicable)
  • Changes are tested and related VM images are successfully generated

Copilot AI review requested due to automatic review settings July 2, 2026 10:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.sh to abort when the Docker CLI plugin asset architecture (from toolset) doesn’t match the host-detected docker_arch, avoiding runtime exec format error.
  • Scoped Packer -only selection in images.CI/linux-and-win/build-image.ps1 from a prefix glob ($buildName*) to a build-address glob ($buildName.*), preventing unintended selection of similarly-prefixed builds (e.g., ubuntu-22_04 also triggering ubuntu-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.

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

Labels

None yet

Projects

None yet

2 participants