Skip to content
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

Allow building buildx from source #99

merged 1 commit into from Jul 2, 2021


Copy link

@crazy-max crazy-max commented Jun 30, 2021

Closes #98

I made some changes from what we said in #98. Now buildx will be built on-the-fly against the reference passed to build-ref input. Here is a workflow:

    runs-on: ubuntu-latest
      fail-fast: false
          - master
          - refs/tags/v0.5.1
          - refs/pull/648/head
        name: Checkout
        uses: actions/checkout@v2
        name: Set up Docker Buildx
        uses: docker/setup-buildx-action@v1
          build-ref:${{ matrix.ref }}
        name: Check version
        run: |
          docker buildx version


cc @tonistiigi

Signed-off-by: CrazyMax

@crazy-max crazy-max force-pushed the build-ref branch 2 times, most recently from b592f11 to f258f34 Compare Jun 30, 2021
src/buildx.ts Outdated
return tc.cacheFile(
context.osPlat == 'win32' ? 'docker-buildx.exe' : 'docker-buildx',
Copy link
Member Author

@crazy-max crazy-max Jun 30, 2021

Choose a reason for hiding this comment

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

Binary will be cached. Atm remote ref sha is used as cache key. ${repo}-${sha} would be safer imo but it's fine in the meantime.

Copy link

@tonistiigi tonistiigi left a comment

Overall LGTM but the build-ref name is not great. Maybe buildx-source? Theoretically, we could also just use the version field and detect if it is a URL to a git repo.

Signed-off-by: CrazyMax <>
Copy link
Member Author

@crazy-max crazy-max commented Jul 2, 2021


we could also just use the version field and detect if it is a URL to a git repo.

Ok I've changed the version input behavior to handle a git context if we want to build from source.

@crazy-max crazy-max changed the title Add build-ref input Allow building buildx from source Jul 2, 2021
@crazy-max crazy-max merged commit e673438 into docker:master Jul 2, 2021
25 checks passed
@crazy-max crazy-max deleted the build-ref branch Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants