Skip to content

ci: distribute multi-platform bin-image build #3005

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 20 additions & 60 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ env:
SETUP_BUILDX_VERSION: "edge"
SETUP_BUILDKIT_IMAGE: "moby/buildkit:latest"
SCOUT_VERSION: "1.11.0"
REPO_SLUG: "docker/buildx-bin"
Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately we can't use env object in a reusable workflow input atm.

DESTDIR: "./bin"
TEST_CACHE_SCOPE: "test"
TESTFLAGS: "-v --parallel=6 --timeout=30m"
Expand Down Expand Up @@ -408,67 +407,28 @@ jobs:
if-no-files-found: error

bin-image:
runs-on: ubuntu-24.04
uses: crazy-max/.github/.github/workflows/bake-distribute-mp.yml@a94383ec9e125b23907fb6fcebf7ff87964595e5
needs:
- test-integration
- test-unit
if: ${{ github.event_name != 'pull_request' && github.repository == 'docker/buildx' }}
steps:
-
name: Free disk space
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1
with:
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up QEMU
uses: docker/setup-qemu-action@v3
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: ${{ env.SETUP_BUILDX_VERSION }}
driver-opts: image=${{ env.SETUP_BUILDKIT_IMAGE }}
buildkitd-flags: --debug
-
name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.REPO_SLUG }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
bake-target: meta-helper
-
name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ vars.DOCKERPUBLICBOT_USERNAME }}
password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }}
-
name: Build and push image
uses: docker/bake-action@v6
with:
source: .
files: |
./docker-bake.hcl
${{ steps.meta.outputs.bake-file }}
targets: image-cross
push: ${{ github.event_name != 'pull_request' }}
sbom: true
set: |
*.cache-from=type=gha,scope=bin-image
*.cache-to=type=gha,scope=bin-image,mode=max
with:
target: image-cross
push: ${{ github.event_name != 'pull_request' && github.repository == 'docker/buildx' }}
cache: true
cache-scope: bin-image
meta-image: docker/buildx-bin
meta-tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
meta-bake-target: meta-helper
login-username: ${{ vars.DOCKERPUBLICBOT_USERNAME }}
buildx-version: edge
buildx-driver-opts: image=moby/buildkit:latest
buildkitd-flags: --debug
bake-source: .
Copy link
Member Author

Choose a reason for hiding this comment

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

Putting this one back in draft as using git context makes the buildx version being wrong related to #3155

Checkout the repository instead of using Git context as temporary workaround

secrets:
login-password: ${{ secrets.DOCKERPUBLICBOT_WRITE_PAT }}

scout:
runs-on: ubuntu-24.04
Expand All @@ -494,7 +454,7 @@ jobs:
with:
version: ${{ env.SCOUT_VERSION }}
format: sarif
image: registry://${{ env.REPO_SLUG }}:master
image: registry://docker/buildx-bin:master
-
name: Upload SARIF report
uses: github/codeql-action/upload-sarif@v3
Expand Down