Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: docker/setup-buildx-action
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.1.0
Choose a base ref
...
head repository: docker/setup-buildx-action
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v3.2.0
Choose a head ref
  • 11 commits
  • 15 files changed
  • 2 contributors

Commits on Mar 1, 2024

  1. build(deps): bump @docker/actions-toolkit from 0.17.0 to 0.18.0

    Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.17.0 to 0.18.0.
    - [Release notes](https://github.com/docker/actions-toolkit/releases)
    - [Commits](docker/actions-toolkit@v0.17.0...v0.18.0)
    
    ---
    updated-dependencies:
    - dependency-name: "@docker/actions-toolkit"
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Mar 1, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8e1cfa5 View commit details
  2. chore: update generated content

    Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
    crazy-max committed Mar 1, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    crazy-max CrazyMax
    Copy the full SHA
    12d65f6 View commit details
  3. Merge pull request #302 from docker/dependabot/npm_and_yarn/docker/ac…

    …tions-toolkit-0.18.0
    
    build(deps): bump @docker/actions-toolkit from 0.17.0 to 0.18.0
    crazy-max authored Mar 1, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    d89f1f9 View commit details
  4. chore: remove docs dir

    Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
    crazy-max committed Mar 1, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    crazy-max CrazyMax
    Copy the full SHA
    0150f0e View commit details
  5. Merge pull request #304 from crazy-max/rm-docs-dir

    chore: remove docs dir
    crazy-max authored Mar 1, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    b7cf918 View commit details
  6. rename and align config inputs

    Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
    crazy-max committed Mar 1, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    crazy-max CrazyMax
    Copy the full SHA
    f876da6 View commit details
  7. chore: update generated content

    Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
    crazy-max committed Mar 1, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    crazy-max CrazyMax
    Copy the full SHA
    c23f46e View commit details
  8. Merge pull request #303 from crazy-max/fix-inputs

    rename and align config inputs
    crazy-max authored Mar 1, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    56a16b8 View commit details

Commits on Mar 14, 2024

  1. build(deps): bump @docker/actions-toolkit from 0.18.0 to 0.19.0

    Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.18.0 to 0.19.0.
    - [Release notes](https://github.com/docker/actions-toolkit/releases)
    - [Commits](docker/actions-toolkit@v0.18.0...v0.19.0)
    
    ---
    updated-dependencies:
    - dependency-name: "@docker/actions-toolkit"
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    dependabot[bot] authored Mar 14, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    11c9683 View commit details
  2. chore: update generated content

    Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
    crazy-max committed Mar 14, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    crazy-max CrazyMax
    Copy the full SHA
    0f00370 View commit details
  3. Merge pull request #306 from docker/dependabot/npm_and_yarn/docker/ac…

    …tions-toolkit-0.19.0
    
    build(deps): bump @docker/actions-toolkit from 0.18.0 to 0.19.0
    crazy-max authored Mar 14, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2b51285 View commit details
Showing with 129 additions and 233 deletions.
  1. +3 −3 .github/workflows/ci.yml
  2. +17 −17 README.md
  3. +55 −0 __tests__/context.test.ts
  4. +1 −0 __tests__/fixtures/buildkitd.toml
  5. +16 −7 action.yml
  6. +7 −7 dist/index.js
  7. +1 −1 dist/index.js.map
  8. +0 −155 dist/licenses.txt
  9. +0 −3 docs/advanced/append-nodes.md
  10. +0 −3 docs/advanced/auth.md
  11. +0 −3 docs/advanced/buildkit-config.md
  12. +0 −3 docs/advanced/standalone.md
  13. +1 −1 package.json
  14. +8 −8 src/context.ts
  15. +20 −22 yarn.lock
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -251,7 +251,7 @@ jobs:
uses: ./
with:
buildkitd-flags: --debug
config: /tmp/buildkitd.toml
buildkitd-config: /tmp/buildkitd.toml
-
name: Build
uses: docker/build-push-action@v5
@@ -275,7 +275,7 @@ jobs:
uses: ./
with:
buildkitd-flags: --debug
config-inline: |
buildkitd-config-inline: |
debug = true
[registry."docker.io"]
mirrors = ["mirror.gcr.io"]
@@ -564,7 +564,7 @@ jobs:
with:
context: .

cacheBinary:
cache-binary:
runs-on: ubuntu-latest
strategy:
fail-fast: false
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -85,23 +85,23 @@ The following inputs can be used as `step.with` keys:
> platforms: linux/amd64,linux/arm64
> ```

| Name | Type | Default | Description |
|-------------------|----------|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `version` | String | | [Buildx](https://github.com/docker/buildx) version. (eg. `v0.3.0`, `latest`, `https://github.com/docker/buildx.git#master`) |
| `driver` | String | `docker-container` | Sets the [builder driver](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver) to be used |
| `driver-opts` | List | | List of additional [driver-specific options](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver-opt) (eg. `image=moby/buildkit:master`) |
| `buildkitd-flags` | String | | [Flags for buildkitd](https://docs.docker.com/engine/reference/commandline/buildx_create/#buildkitd-flags) daemon |
| `install` | Bool | `false` | Sets up `docker build` command as an alias to `docker buildx` |
| `use` | Bool | `true` | Switch to this builder instance |
| `endpoint` | String | | [Optional address for docker socket](https://docs.docker.com/engine/reference/commandline/buildx_create/#description) or context from `docker context ls` |
| `platforms` | List/CSV | | Fixed [platforms](https://docs.docker.com/engine/reference/commandline/buildx_create/#platform) for current node. If not empty, values take priority over the detected ones. |
| `config`¹ | String | | [BuildKit config file](https://docs.docker.com/engine/reference/commandline/buildx_create/#config) |
| `config-inline`¹ | String | | Same as `config` but inline |
| `append` | YAML | | [Append additional nodes](docs/advanced/append-nodes.md) to the builder |
| `cache-binary` | Bool | `true` | Cache buildx binary to GitHub Actions cache backend |
| `cleanup` | Bool | `true` | Cleanup temp files and remove builder at the end of a job |

> * ¹ `config` and `config-inline` are mutually exclusive
| Name | Type | Default | Description |
|------------------------------|----------|--------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `version` | String | | [Buildx](https://github.com/docker/buildx) version. (eg. `v0.3.0`, `latest`, `https://github.com/docker/buildx.git#master`) |
| `driver` | String | `docker-container` | Sets the [builder driver](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver) to be used |
| `driver-opts` | List | | List of additional [driver-specific options](https://docs.docker.com/engine/reference/commandline/buildx_create/#driver-opt) (eg. `image=moby/buildkit:master`) |
| `buildkitd-flags` | String | | [BuildKit daemon flags](https://docs.docker.com/engine/reference/commandline/buildx_create/#buildkitd-flags) |
| `buildkitd-config` \* | String | | [BuildKit daemon config file](https://docs.docker.com/engine/reference/commandline/buildx_create/#config) |
| `buildkitd-config-inline` \* | String | | Same as `buildkitd-config` but inline |
| `install` | Bool | `false` | Sets up `docker build` command as an alias to `docker buildx` |
| `use` | Bool | `true` | Switch to this builder instance |
| `endpoint` | String | | [Optional address for docker socket](https://docs.docker.com/engine/reference/commandline/buildx_create/#description) or context from `docker context ls` |
| `platforms` | List/CSV | | Fixed [platforms](https://docs.docker.com/engine/reference/commandline/buildx_create/#platform) for current node. If not empty, values take priority over the detected ones. |
| `append` | YAML | | [Append additional nodes](https://docs.docker.com/build/ci/github-actions/configure-builder/#append-additional-nodes-to-the-builder) to the builder |
| `cache-binary` | Bool | `true` | Cache buildx binary to GitHub Actions cache backend |
| `cleanup` | Bool | `true` | Cleanup temp files and remove builder at the end of a job |

_\* `buildkitd-config` and `buildkitd-config-inline` are mutually exclusive_

### outputs

55 changes: 55 additions & 0 deletions __tests__/context.test.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
import {beforeEach, describe, expect, jest, test} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';
import * as uuid from 'uuid';
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx';
import {Context} from '@docker/actions-toolkit/lib/context';
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
import {Node} from '@docker/actions-toolkit/lib/types/builder';

import * as context from '../src/context';

const fixturesDir = path.join(__dirname, 'fixtures');
// prettier-ignore
const tmpDir = path.join(process.env.TEMP || '/tmp', 'setup-buildx-jest');
const tmpName = path.join(tmpDir, '.tmpname-jest');

jest.spyOn(Context, 'tmpDir').mockImplementation((): string => {
if (!fs.existsSync(tmpDir)) {
fs.mkdirSync(tmpDir, {recursive: true});
}
return tmpDir;
});

jest.spyOn(Context, 'tmpName').mockImplementation((): string => {
return tmpName;
});

jest.mock('uuid');
jest.spyOn(uuid, 'v4').mockReturnValue('9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d');

@@ -171,6 +190,42 @@ describe('getCreateArgs', () => {
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
'--driver', 'unknown',
]
],
[
8,
'v0.10.3',
new Map<string, string>([
['install', 'false'],
['use', 'false'],
['buildkitd-config', path.join(fixturesDir, 'buildkitd.toml')],
['cache-binary', 'true'],
['cleanup', 'true'],
]),
[
'create',
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
'--driver', 'docker-container',
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
'--config', tmpName,
]
],
[
9,
'v0.10.3',
new Map<string, string>([
['install', 'false'],
['use', 'false'],
['buildkitd-config-inline', 'debug = true'],
['cache-binary', 'true'],
['cleanup', 'true'],
]),
[
'create',
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
'--driver', 'docker-container',
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
'--config', tmpName,
]
]
])(
'[%d] given buildx %s and %p as inputs, returns %p',
1 change: 1 addition & 0 deletions __tests__/fixtures/buildkitd.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
debug = true
23 changes: 16 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
@@ -18,9 +18,15 @@ inputs:
description: 'List of additional driver-specific options. (eg. image=moby/buildkit:master)'
required: false
buildkitd-flags:
description: 'Flags for buildkitd daemon'
description: 'BuildKit daemon flags'
default: '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host'
required: false
buildkitd-config:
description: 'BuildKit daemon config file'
required: false
buildkitd-config-inline:
description: 'Inline BuildKit daemon config'
required: false
install:
description: 'Sets up docker build command as an alias to docker buildx build'
default: 'false'
@@ -35,12 +41,6 @@ inputs:
platforms:
description: 'Fixed platforms for current node. If not empty, values take priority over the detected ones'
required: false
config:
description: 'BuildKit config file'
required: false
config-inline:
description: 'Inline BuildKit config'
required: false
append:
description: 'Append additional nodes to the builder'
required: false
@@ -52,6 +52,15 @@ inputs:
description: 'Cleanup temp files and remove builder at the end of a job'
default: 'true'
required: false
# deprecated inputs
config:
description: 'BuildKit daemon config file'
deprecationMessage: 'Use buildkitd-config instead'
required: false
config-inline:
description: 'Inline BuildKit daemon config'
deprecationMessage: 'Use buildkitd-config-inline instead'
required: false

outputs:
name:
14 changes: 7 additions & 7 deletions dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

155 changes: 0 additions & 155 deletions dist/licenses.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions docs/advanced/append-nodes.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/advanced/auth.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/advanced/buildkit-config.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/advanced/standalone.md

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@docker/actions-toolkit": "^0.17.0",
"@docker/actions-toolkit": "^0.19.0",
"js-yaml": "^4.1.0",
"uuid": "^9.0.1"
},
Loading