Skip to content

Add arm64 support to container image builds#16020

Closed
Copilot wants to merge 12 commits intomainfrom
copilot/update-container-image-arm64
Closed

Add arm64 support to container image builds#16020
Copilot wants to merge 12 commits intomainfrom
copilot/update-container-image-arm64

Conversation

Copy link
Contributor

Copilot AI commented Feb 16, 2026

Container images were only built for linux/amd64 despite release binaries being compiled for both amd64 and arm64 architectures.

Changes

  • Dockerfile: Replace hardcoded BINARY build arg with Buildx automatic TARGETOS/TARGETARCH args for platform-aware binary selection, with defaults (TARGETOS=linux, TARGETARCH=amd64) for local development
    # Before: COPY ${BINARY} /usr/local/bin/gh-aw
    # After:  COPY dist/${TARGETOS}-${TARGETARCH} /usr/local/bin/gh-aw
  • release.md: Add QEMU emulation setup and update both validation and production Docker builds to target linux/amd64,linux/arm64
  • Makefile: Migrate docker-build target from docker build to docker buildx build with buildx availability check, and add dist directory preparation to copy binaries from repo root (gh-aw-linux-amd64, gh-aw-linux-arm64) to expected structure (dist/linux-amd64, dist/linux-arm64)
  • ci.yml: Update alpine-container-test job to use new Docker build approach with dist directory preparation and Buildx setup. Add new alpine-container-test-arm64 job with QEMU emulation to test ARM64 Docker builds
  • Validation: Add --version check post-copy to fail fast on missing/incorrect binaries
  • Tests: Enhanced integration tests to verify both amd64 and arm64 binaries are built, dist directory structure is correctly created, and Dockerfile contains expected binary path pattern

Single docker buildx build command now produces native images for both platforms. QEMU emulation enables ARM64 builds on AMD64 runners without "exec format error" failures.

CI Testing

The CI workflow now includes comprehensive multi-platform testing:

  • alpine-container-test - Validates AMD64 Docker builds and functionality
  • alpine-container-test-arm64 - Validates ARM64 Docker builds and functionality using QEMU emulation

Both jobs verify that Docker images can be built, binaries work correctly, and the compile command functions properly in containers for their respective architectures.

Developer Experience Improvements

  • ARG defaults: Dockerfile works with plain docker build for local development
  • Error messages: Buildx availability check provides clear installation instructions
  • QEMU setup: Enables reliable ARM64 builds on AMD64 development machines
Original prompt

Review container image generation in release.md and determine if the image also support arm64.

Update to support arm64.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.


Changeset

  • Type: patch
  • Description: Updated the Docker build flow to build linux/amd64 and linux/arm64 images via buildx and dist/(platform) binaries.

Generated by Changeset Generator


Changeset

  • Type: patch
  • Description: Updated the release, Makefile, CI workflows, and Docker build scripts so linux/amd64 and linux/arm64 container images are produced and validated via buildx.

Generated by Changeset Generator


Changeset

  • Type: patch
  • Description: Added a changeset describing the updated dist/buildx flow that produces linux/amd64 and linux/arm64 container images.

Generated by Changeset Generator

@github-actions
Copy link
Contributor

Smoke Test Results

PRs Tested:

Test Results:

  • ✅ GitHub MCP
  • ✅ Safe Inputs GH CLI
  • ⚠️ Serena MCP (Tool discovery only)
  • ✅ Playwright
  • ✅ File Writing
  • ✅ Bash Tool
  • ✅ Discussion Interaction
  • ✅ Build gh-aw
  • ✅ Discussion Creation
  • ✅ Workflow Dispatch
  • ✅ PR Review

Overall Status: PASS ✅

cc @pelikhan @Copilot

📰 BREAKING: Report filed by Smoke Copilot

Copilot AI and others added 2 commits February 16, 2026 01:31
- Update Dockerfile to use TARGETOS and TARGETARCH build args
- Remove hardcoded BINARY build arg in favor of multi-platform automatic selection
- Update release.md workflow to build for linux/amd64,linux/arm64
- Update Makefile docker-build to use buildx for consistency
- Update docker_build_integration_test.go to check for new ARG format

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add documentation for expected ARG values (TARGETOS, TARGETARCH)
- Add note about explicit build args for local builds without buildx
- Add binary validation step to fail fast if binary is missing or not executable

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update container image generation to support arm64 Add arm64 support to container image builds Feb 16, 2026
Copilot AI requested a review from pelikhan February 16, 2026 01:37
@pelikhan
Copy link
Contributor

@copilot review changes and make sure they are correct and validated.

Update Dockerfile tests.

- Add dist directory preparation in docker-build and docker-build-multiarch targets
- Copy binaries from repo root to dist/linux-amd64 and dist/linux-arm64
- Update TestDockerBuild_WithMake to verify dist directory structure is created
- Add verification for both amd64 and arm64 binaries in tests
- Add dist/${TARGETOS}-${TARGETARCH} pattern check in Dockerfile tests

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 16, 2026

@copilot review changes and make sure they are correct and validated.

Update Dockerfile tests.

Changes reviewed and validated. Updated Dockerfile tests and fixed Makefile to properly create dist directory structure for multi-platform builds.

Key fixes in commit 1fc6df0:

  • Makefile docker-build and docker-build-multiarch now prepare dist/ directory and copy binaries
  • Integration tests verify both amd64 and arm64 binaries are created
  • Tests validate dist directory structure matches Dockerfile expectations (dist/linux-amd64, dist/linux-arm64)
  • Added check for dist/${TARGETOS}-${TARGETARCH} pattern in Dockerfile content

All integration tests pass ✓

@pelikhan
Copy link
Contributor

@copilot do another round of review. Check ci.yml.

- Replace old docker build with docker buildx build for consistency
- Add dist directory preparation step before Docker build
- Remove obsolete --build-arg BINARY parameter
- Use --platform linux/amd64 and --load flags for CI testing

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 16, 2026

@copilot do another round of review. Check ci.yml.

Reviewed ci.yml and updated the Alpine container test job to use the new Docker build approach.

Changes in commit 8694065:

  • Replaced docker build --build-arg BINARY=gh-aw-linux-amd64 with docker buildx build --platform linux/amd64
  • Added dist directory preparation step before Docker build (consistent with Makefile and release.md)
  • Removed obsolete --build-arg BINARY parameter
  • Added --load flag to load image into local Docker daemon for CI testing

The CI workflow now uses the same build process as the release workflow and Makefile ✓

@pelikhan
Copy link
Contributor

@copilot make sure ci.yml has a job that tests the arm64 build as well

- Add new alpine-container-test-arm64 job to test ARM64 Docker builds
- Set up QEMU emulation for ARM64 architecture testing
- Build and test ARM64 Docker image with --platform linux/arm64
- Run compile command and verify lock file generation on ARM64
- Test verifies ARM64 binary works correctly in Alpine container
- Provides comprehensive ARM64 build validation in CI

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 16, 2026

@copilot make sure ci.yml has a job that tests the arm64 build as well

Added ARM64 container test job to CI workflow in commit 4472fc1.

New alpine-container-test-arm64 job:

  • Sets up QEMU emulation for ARM64 architecture testing
  • Builds ARM64 Docker image using docker buildx build --platform linux/arm64
  • Tests ARM64 image with --platform linux/arm64 flag on all docker run commands
  • Runs compile command in ARM64 container to verify functionality
  • Validates lock file generation works correctly on ARM64

CI now tests both AMD64 (alpine-container-test) and ARM64 (alpine-container-test-arm64) Docker builds ✓

@pelikhan
Copy link
Contributor

@copilot do a complete review of the changes for consistency.

Ensure running release.md will produce images for arm64/amd64

@github-actions
Copy link
Contributor

PRs: Remove SupportsHTTPTransport from engine interface; Enforce add_comment constraints at MCP server invocation
GitHub MCP (2 merged PRs): ✅
Serena MCP (activate+find_symbol>=3): ❌ (MCP error)
Playwright github.com title: ✅
File write+cat: ✅
Build (make build): ✅
Overall: FAIL

🔮 The oracle has spoken through Smoke Codex for issue #16020

@pelikhan
Copy link
Contributor

- Add QEMU setup to release.md for ARM64 cross-compilation support
- Add default values to Dockerfile ARGs (TARGETOS=linux, TARGETARCH=amd64)
- Add buildx availability check to Makefile docker-build target
- Ensures multi-platform builds work reliably on amd64 runners
- Improves local development experience with better defaults and error messages

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 16, 2026

@copilot Fix this issue: https://github.com/github/gh-aw/actions/runs/22049047967/job/63703292705#step:8:1

Fixed CI failure and addressed PR review feedback in commit e2aa789.

Root cause: Multi-platform Docker builds (linux/amd64,linux/arm64) require QEMU emulation on AMD64 runners to execute ARM64 binaries during the build process.

Fixes applied:

  1. Added setup-qemu-action@v3 to release workflow before Docker builds (prevents "exec format error" when building ARM64)
  2. Added default values to Dockerfile ARGs (TARGETOS=linux, TARGETARCH=amd64) for better local development
  3. Added buildx availability check to Makefile docker-build target for clearer error messages

The release workflow will now successfully build and push multi-platform images ✓

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh /usr/bin/gh api graphql -f query=query($owner: String!, $name: String!) { repository(owner: $owner, name: $name) { hasDiscussionsEnabled } } -f owner=github -f name=gh-aw (http block)
  • https://api.github.com/repos/actions/ai-inference/git/ref/tags/v2
    • Triggering command: /usr/bin/gh gh api /repos/actions/ai-inference/git/ref/tags/v2 --jq .object.sha on&#39; --ignore-path ../../../.pret.prettierignore (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/11bd71901bbe5b1630ceea73d27597364c9af683
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/11bd71901bbe5b1630ceea73d27597364c9af683 --jq .object.sha (http block)
  • https://api.github.com/repos/actions/checkout/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha json&#39; --ignore-premote.origin.url (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/checkout/git/ref/tags/v6 --jq .object.sha ./../pkg/workflow/js/**/*.json&#39; --ignore-path (http block)
  • https://api.github.com/repos/actions/download-artifact/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/download-artifact/git/ref/tags/v6 --jq .object.sha (http block)
  • https://api.github.com/repos/actions/github-script/git/ref/tags/v7
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v7 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v7 --jq .object.sha h ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/github-script/git/ref/tags/v7 --jq .object.sha h ../../../.pret.prettierignore (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/4dc6199c7b1a012772edbd06daecab0f50c9053c
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/4dc6199c7b1a012772edbd06daecab0f50c9053c --jq .object.sha ../pkg/workflow/js/**/*.json&#39; --ignore-path ../../../.prettierignore (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v5 --jq .object.sha (http block)
  • https://api.github.com/repos/actions/setup-go/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v6 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v6 --jq .object.sha h ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-go/git/ref/tags/v6 --jq .object.sha json&#39; --ignore-path ../../../.pr**/*.json (http block)
  • https://api.github.com/repos/actions/setup-node/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq .object.sha h ../../../.prettierignore (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/setup-node/git/ref/tags/v6 --jq .object.sha json&#39; --ignore-path ../../../.pr**/*.json (http block)
  • https://api.github.com/repos/actions/upload-artifact/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v6 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v6 --jq .object.sha -c=4 -nolocalimports -importcfg /tmp/go-build3167723183/b001/importcfg -pack /home/REDACTED/work/gh-aw/gh-aw/cmd/gh-aw/main.go (http block)
    • Triggering command: /usr/bin/gh gh api /repos/actions/upload-artifact/git/ref/tags/v6 --jq .object.sha ath ../../../.prettierignore (http block)
  • https://api.github.com/repos/anchore/sbom-action/git/ref/tags/v0
    • Triggering command: /usr/bin/gh gh api /repos/anchore/sbom-action/git/ref/tags/v0 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/anchore/sbom-action/git/ref/tags/v0 --jq .object.sha ./../pkg/workflow/js/**/*.json&#39; --ignore-path ../../../.prettierignore (http block)
  • https://api.github.com/repos/docker/build-push-action/git/ref/tags/v6
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v6 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v6 --jq .object.sha ./../pkg/workflo-f (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/build-push-action/git/ref/tags/v6 --jq .object.sha ../pkg/workflow/js/**/*.json&#39; --gh-aw (http block)
  • https://api.github.com/repos/docker/login-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/login-action/git/ref/tags/v3 --jq .object.sha (http block)
  • https://api.github.com/repos/docker/metadata-action/git/ref/tags/v5
    • Triggering command: /usr/bin/gh gh api /repos/docker/metadata-action/git/ref/tags/v5 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/metadata-action/git/ref/tags/v5 --jq .object.sha ithub/workflows (http block)
  • https://api.github.com/repos/docker/setup-buildx-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/setup-buildx-action/git/ref/tags/v3 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/setup-buildx-action/git/ref/tags/v3 --jq .object.sha ./../pkg/workflow/js/**/*.json&#39; --ignore-path (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/setup-buildx-action/git/ref/tags/v3 --jq .object.sha ./../pkg/workflow/js/**/*.json&#39; --ignore-path ../../../.prettierignore (http block)
  • https://api.github.com/repos/docker/setup-qemu-action/git/ref/tags/v3
    • Triggering command: /usr/bin/gh gh api /repos/docker/setup-qemu-action/git/ref/tags/v3 --jq .object.sha (http block)
    • Triggering command: /usr/bin/gh gh api /repos/docker/setup-qemu-action/git/ref/tags/v3 --jq .object.sha ./../pkg/workflow/js/**/*.json&#39; --ignore-path (http block)
  • https://api.github.com/repos/github/gh-aw/git/ref/tags/c4e091835c7a94dc7d3acb8ed3ae145afb4995f3
    • Triggering command: /usr/bin/gh gh api /repos/github/gh-aw/git/ref/tags/c4e091835c7a94dc7d3acb8ed3ae145afb4995f3 --jq .object.sha (http block)
  • https://api.github.com/repos/githubnext/agentics/git/ref/tags/-
    • Triggering command: /usr/bin/gh gh api /repos/githubnext/agentics/git/ref/tags/- --jq .object.sha (http block)
  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@github-actions
Copy link
Contributor

github-actions bot commented Feb 16, 2026

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions
Copy link
Contributor

🧪 Smoke Project is now testing project operations...

@github-actions
Copy link
Contributor

🧪 Smoke Temporary ID is now testing temporary ID functionality...

@github-actions
Copy link
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 16, 2026

💫 TO BE CONTINUED... Smoke Claude failed! Our hero faces unexpected challenges...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 16, 2026

Smoke Copilot SDK failed. Please review the logs for details.

@github-actions
Copy link
Contributor

📰 DEVELOPING STORY: Smoke Copilot reports failed. Our correspondents are investigating the incident...

@github-actions
Copy link
Contributor

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.52.0
jq 1.7
yq 4.52.2
curl 8.5.0
gh 2.86.0
node 20.20.0
python3 3.12.3
go 1.24.13
java available
dotnet 10.0.102

Result: 12/12 tools available ✅

🔧 Tool validation by Agent Container Smoke Test for issue #16020

@github-actions
Copy link
Contributor

Smoke Temporary ID completed successfully. Temporary ID validation passed.

@github-actions
Copy link
Contributor

Smoke Project completed successfully. All project operations validated.

@github-actions
Copy link
Contributor

PRs: Fix enable/disable ignoring --repo flag for workflow status check | Fix nil pointer panic in DirExists on permission errors
GitHub MCP: ✅
Serena MCP: ✅
Playwright: ✅
File write: ✅
Bash cat: ✅
Build gh-aw: ✅
Overall: PASS

🔮 The oracle has spoken through Smoke Codex for issue #16020

@pelikhan pelikhan closed this Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants