-
Notifications
You must be signed in to change notification settings - Fork 212
Add arm64 support to container image builds #16020
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
987edc0
5ad7317
03bae5e
1fc6df0
8694065
4472fc1
9b74755
1b77992
acefcfc
e2aa789
d1e8b09
bf83d16
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,38 @@ | ||
| # Dockerfile for GitHub Agentic Workflows compiler | ||
| # Provides a minimal container with gh-aw, gh CLI, git, and jq | ||
|
|
||
| # Use Alpine for minimal size (official distribution) | ||
| FROM alpine:3.21 | ||
| # Use Alpine 3.19 for minimal size (3.20+ removed gh CLI due to Python 3.12 compatibility) | ||
| FROM alpine:3.19 | ||
|
|
||
| # Install required dependencies | ||
| RUN apk add --no-cache \ | ||
| RUN apk update && apk add --no-cache \ | ||
| git \ | ||
| jq \ | ||
| bash \ | ||
| curl \ | ||
| ca-certificates \ | ||
| github-cli | ||
| gh | ||
|
|
||
| # Accept build argument for binary name (defaults to linux-amd64) | ||
| ARG BINARY=gh-aw-linux-amd64 | ||
| # Docker Buildx automatically provides these ARGs for multi-platform builds | ||
| # Expected values: TARGETOS=linux, TARGETARCH=amd64|arm64 | ||
| # For local builds without buildx, these must be provided explicitly: | ||
| # docker build --build-arg TARGETOS=linux --build-arg TARGETARCH=amd64 ... | ||
| # Default to linux/amd64 if not provided | ||
| ARG TARGETOS=linux | ||
| ARG TARGETARCH=amd64 | ||
|
|
||
| # Create a directory for the binary | ||
| WORKDIR /usr/local/bin | ||
|
|
||
| # Copy the gh-aw binary from build context | ||
| COPY ${BINARY} /usr/local/bin/gh-aw | ||
| # Copy the appropriate binary based on target platform | ||
| # TARGETOS=linux, TARGETARCH=amd64 -> dist/linux-amd64 | ||
| # TARGETOS=linux, TARGETARCH=arm64 -> dist/linux-arm64 | ||
| COPY dist/${TARGETOS}-${TARGETARCH} /usr/local/bin/gh-aw | ||
|
Comment on lines
16
to
30
|
||
|
|
||
| # Ensure the binary is executable | ||
| RUN chmod +x /usr/local/bin/gh-aw | ||
| # Ensure the binary is executable and verify it exists | ||
| RUN chmod +x /usr/local/bin/gh-aw && \ | ||
| /usr/local/bin/gh-aw --version || \ | ||
| (echo "Error: gh-aw binary not found or not executable" && exit 1) | ||
|
|
||
| # Configure git to trust all directories to avoid "dubious ownership" errors | ||
| # This is necessary when the container runs with mounted volumes owned by different users | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This job switched from
docker buildtodocker buildx buildbut does not explicitly set up Buildx. GitHub-hosted runners usually have buildx, but it can be missing/misconfigured and cause flaky failures. Consider adding docker/setup-buildx-action@v3 (and creating/using a builder) before invokingdocker buildx build.