2
0
Fork 0
mirror of https://github.com/docker/setup-buildx-action.git synced 2025-04-03 10:06:34 +00:00

Compare commits

...

99 commits

Author SHA1 Message Date
CrazyMax
941183f0a0
Merge pull request from crazy-max/ci-dispatch
ci: add workflow_dispatch event
2025-03-28 10:00:25 +01:00
CrazyMax
311b62b254
ci: add workflow_dispatch event
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-03-18 15:39:20 +01:00
CrazyMax
afeb29a6e0
Merge pull request from crazy-max/test-windows
ci: test container builder on windows
2025-03-12 15:56:50 +01:00
CrazyMax
b560416601
Merge pull request from crazy-max/ci-bump-ubuntu
ci: bump to ubuntu-latest
2025-03-12 15:56:34 +01:00
CrazyMax
516bb780e5
ci: bump to ubuntu-latest
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-03-12 15:49:49 +01:00
CrazyMax
11445527f0
ci: test container builder on windows
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-03-12 15:44:27 +01:00
CrazyMax
b5ca514318
Merge pull request from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.56.0
build(deps): bump @docker/actions-toolkit from 0.54.0 to 0.56.0
2025-02-26 15:35:00 +01:00
CrazyMax
1418a4ef33
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-02-26 15:32:43 +01:00
dependabot[bot]
93acf831ce
build(deps): bump @docker/actions-toolkit from 0.54.0 to 0.56.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.54.0 to 0.56.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.54.0...v0.56.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>
2025-02-26 14:25:44 +00:00
CrazyMax
f7ce87c1d6
Merge pull request from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.54.0
build(deps): bump @docker/actions-toolkit from 0.53.0 to 0.54.0
2025-02-06 14:25:21 +01:00
CrazyMax
aa1e2a0b49
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-02-06 14:17:41 +01:00
dependabot[bot]
673e008776
build(deps): bump @docker/actions-toolkit from 0.53.0 to 0.54.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.53.0 to 0.54.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.53.0...v0.54.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>
2025-02-05 04:05:45 +00:00
CrazyMax
ba31df4664
Merge pull request from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.53.0
build(deps): bump @docker/actions-toolkit from 0.48.0 to 0.53.0
2025-01-24 10:26:10 +01:00
CrazyMax
5475af18ec
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-01-24 10:21:34 +01:00
dependabot[bot]
acacad903e
build(deps): bump @docker/actions-toolkit from 0.48.0 to 0.53.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.48.0 to 0.53.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.48.0...v0.53.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>
2025-01-24 04:40:58 +00:00
CrazyMax
6a25f988bd
Merge pull request from crazy-max/bake-v6
update bake-action to v6
2025-01-08 18:54:07 +01:00
CrazyMax
ca1af179f5
update bake-action to v6
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2025-01-08 13:01:31 +01:00
Tõnis Tiigi
6524bf65af
Merge pull request from crazy-max/buildx-cloud-latest
make cloud prefix optional to download buildx if driver is cloud
2024-12-12 10:30:19 -08:00
CrazyMax
8d5e0747fc
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-12-12 15:39:12 +01:00
CrazyMax
7199e57b35
make cloud prefix optional to download buildx if driver is cloud
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-12-12 15:39:12 +01:00
CrazyMax
db63cee3de
Merge pull request from docker/dependabot/github_actions/codecov/codecov-action-5
build(deps): bump codecov/codecov-action from 4 to 5
2024-12-12 15:07:22 +01:00
CrazyMax
043ebe137f
Merge pull request from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.48.0
build(deps): bump @docker/actions-toolkit from 0.39.0 to 0.48.0
2024-12-12 15:07:04 +01:00
CrazyMax
686da9073d
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-12-12 15:04:35 +01:00
CrazyMax
a3d74876b8
Merge pull request from docker/dependabot/npm_and_yarn/cross-spawn-7.0.6
build(deps): bump cross-spawn from 7.0.3 to 7.0.6
2024-12-12 15:03:07 +01:00
dependabot[bot]
4dcdbcec48
build(deps): bump @docker/actions-toolkit from 0.39.0 to 0.48.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.39.0 to 0.48.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.39.0...v0.48.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>
2024-12-12 14:03:00 +00:00
CrazyMax
1a8ac74316
ci: fix deprecated input for codecov-action
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-12-12 15:02:42 +01:00
dependabot[bot]
e827ebe8ba
build(deps): bump cross-spawn from 7.0.3 to 7.0.6
Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6.
- [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md)
- [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6)

---
updated-dependencies:
- dependency-name: cross-spawn
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-18 23:00:07 +00:00
dependabot[bot]
adacc1474e
build(deps): bump codecov/codecov-action from 4 to 5
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 4 to 5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-15 04:48:17 +00:00
CrazyMax
0f069ddc17
Merge pull request from crazy-max/publish-immutable-action
ci: publish as immutable action workflow
2024-10-26 00:40:56 +02:00
CrazyMax
d036b3238c
ci: publish as immutable action workflow
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-10-25 13:22:55 +02:00
CrazyMax
460e45646d
Merge pull request from docker/dependabot/npm_and_yarn/actions/core-1.11.1
build(deps): bump @actions/core from 1.10.1 to 1.11.1
2024-10-07 14:19:44 +02:00
CrazyMax
93aa1c807f
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-10-07 14:17:38 +02:00
CrazyMax
d391aad55c
remove uuid package and switch to crypto
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-10-07 14:16:41 +02:00
dependabot[bot]
e5b688ea46
build(deps): bump @actions/core from 1.10.1 to 1.11.1
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.10.1 to 1.11.1.
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-07 04:49:55 +00:00
CrazyMax
c47758b77c
Merge pull request from crazy-max/revert-crypto
switch back to uuid package
2024-10-04 09:42:48 +02:00
CrazyMax
8fea382513
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-10-04 09:35:26 +02:00
CrazyMax
2874e980e8
switch back to uuid package
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-10-04 09:34:00 +02:00
CrazyMax
8026d2bc36
Merge pull request from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.39.0
build(deps): bump @docker/actions-toolkit from 0.35.0 to 0.39.0
2024-10-03 09:29:53 +02:00
CrazyMax
e51aab53e9
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-10-03 09:23:32 +02:00
dependabot[bot]
fd7390e14d
build(deps): bump @docker/actions-toolkit from 0.35.0 to 0.39.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.35.0 to 0.39.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.35.0...v0.39.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>
2024-10-03 07:19:28 +00:00
CrazyMax
910a304005
Merge pull request from crazy-max/remove-uuid
remove uuid package and switch to crypto
2024-10-03 09:18:07 +02:00
CrazyMax
3623ee443e
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-10-03 09:16:05 +02:00
CrazyMax
e0e5ecf670
remove uuid package and switch to crypto
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-10-03 09:15:20 +02:00
CrazyMax
5334dd0cdd
Merge pull request from crazy-max/set-buildkitd-flags-optin
always set buildkitd-flags if opt-in
2024-10-03 09:14:50 +02:00
CrazyMax
214bb6dac1
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-10-03 08:54:56 +02:00
CrazyMax
818c69a4ea
always set buildkitd-flags if opt-in
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-10-03 08:54:55 +02:00
CrazyMax
b467d6aa7a
Merge pull request from docker/dependabot/npm_and_yarn/path-to-regexp-6.3.0
build(deps): bump path-to-regexp from 6.2.2 to 6.3.0
2024-09-12 22:41:49 +02:00
dependabot[bot]
7594cf3831
build(deps): bump path-to-regexp from 6.2.2 to 6.3.0
Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) from 6.2.2 to 6.3.0.
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md)
- [Commits](https://github.com/pillarjs/path-to-regexp/compare/v6.2.2...v6.3.0)

---
updated-dependencies:
- dependency-name: path-to-regexp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-12 19:22:52 +00:00
CrazyMax
988b5a0280
Merge pull request from crazy-max/skip-malformed-context
check for malformed docker context
2024-07-29 18:29:31 +02:00
CrazyMax
2c215620b8
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-29 18:25:27 +02:00
CrazyMax
3382292cd5
check for malformed docker context
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-29 18:24:18 +02:00
CrazyMax
3d68780484
Merge pull request from crazy-max/docker-context-tls
create docker context if default one has TLS data loaded
2024-07-29 15:34:28 +02:00
CrazyMax
d069e98648
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-29 15:16:07 +02:00
CrazyMax
8b850f86dc
create docker context if default one has TLS data loaded
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-29 15:12:05 +02:00
CrazyMax
aa33708b10
Merge pull request from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.35.0
build(deps): bump @docker/actions-toolkit from 0.34.0 to 0.35.0
2024-07-22 11:48:29 +02:00
CrazyMax
2d99e3412d
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-22 11:45:40 +02:00
dependabot[bot]
4dab43650b
build(deps): bump @docker/actions-toolkit from 0.34.0 to 0.35.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.34.0 to 0.35.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.34.0...v0.35.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>
2024-07-22 04:47:18 +00:00
CrazyMax
49a04d6890
Merge pull request from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.34.0
build(deps): bump @docker/actions-toolkit from 0.32.0 to 0.34.0
2024-07-19 13:09:43 +02:00
CrazyMax
a6ade2e34f
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-19 13:07:08 +02:00
CrazyMax
2f2694b8d1
switch to Docker exec
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-19 13:05:34 +02:00
dependabot[bot]
0a4bab6632
build(deps): bump @docker/actions-toolkit from 0.32.0 to 0.34.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.32.0 to 0.34.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.32.0...v0.34.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>
2024-07-18 04:06:15 +00:00
CrazyMax
2ad185228a
Merge pull request from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.32.0
build(deps): bump @docker/actions-toolkit from 0.31.0 to 0.32.0
2024-07-05 11:38:19 +02:00
CrazyMax
560ac469d6
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-05 11:35:45 +02:00
dependabot[bot]
b3a341759e
build(deps): bump @docker/actions-toolkit from 0.31.0 to 0.32.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.31.0 to 0.32.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.31.0...v0.32.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>
2024-07-05 09:33:37 +00:00
CrazyMax
4fd812986e
Merge pull request from docker/dependabot/npm_and_yarn/undici-5.28.4
build(deps): bump undici from 5.28.3 to 5.28.4
2024-07-04 00:59:46 +02:00
CrazyMax
3386dc4251
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-04 00:57:40 +02:00
dependabot[bot]
d191aef416
build(deps): bump undici from 5.28.3 to 5.28.4
Bumps [undici](https://github.com/nodejs/undici) from 5.28.3 to 5.28.4.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v5.28.3...v5.28.4)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-03 22:39:48 +00:00
CrazyMax
f686054aab
Merge pull request from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.31.0
build(deps): bump @docker/actions-toolkit from 0.23.0 to 0.31.0
2024-07-04 00:36:59 +02:00
CrazyMax
78547859d7
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-04 00:28:28 +02:00
CrazyMax
830928c706
fix builder type path
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-04 00:28:27 +02:00
dependabot[bot]
26d2aec173
build(deps): bump @docker/actions-toolkit from 0.23.0 to 0.31.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.23.0 to 0.31.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.23.0...v0.31.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>
2024-07-03 18:22:10 +00:00
CrazyMax
ab17e3ec80
Merge pull request from crazy-max/missing-types-jsyaml
missing types for js-yaml
2024-07-03 20:21:11 +02:00
CrazyMax
d79cb80903
missing types for js-yaml
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-03 20:17:56 +02:00
CrazyMax
13cf78894f
Merge pull request from docker/dependabot/npm_and_yarn/uuid-10.0.0
build(deps): bump uuid from 9.0.1 to 10.0.0
2024-07-03 13:50:25 +02:00
CrazyMax
0e592087a0
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-03 13:33:18 +02:00
CrazyMax
47032b9b53
missing types for uuid
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-07-03 13:33:17 +02:00
CrazyMax
abe89fb761
Merge pull request from docker/dependabot/npm_and_yarn/braces-3.0.3
build(deps): bump braces from 3.0.2 to 3.0.3
2024-06-20 18:01:53 +02:00
CrazyMax
e027232c25
Merge pull request from docker/dependabot/github_actions/docker/bake-action-5
build(deps): bump docker/bake-action from 4 to 5
2024-06-20 17:59:29 +02:00
CrazyMax
5d9397e7ca
Merge pull request from docker/dependabot/github_actions/docker/build-push-action-6
build(deps): bump docker/build-push-action from 5 to 6
2024-06-20 17:59:12 +02:00
dependabot[bot]
e9ab4c6a14
build(deps): bump docker/bake-action from 4 to 5
Bumps [docker/bake-action](https://github.com/docker/bake-action) from 4 to 5.
- [Release notes](https://github.com/docker/bake-action/releases)
- [Commits](https://github.com/docker/bake-action/compare/v4...v5)

---
updated-dependencies:
- dependency-name: docker/bake-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 04:09:56 +00:00
dependabot[bot]
748835b452
build(deps): bump docker/build-push-action from 5 to 6
Bumps [docker/build-push-action](https://github.com/docker/build-push-action) from 5 to 6.
- [Release notes](https://github.com/docker/build-push-action/releases)
- [Commits](https://github.com/docker/build-push-action/compare/v5...v6)

---
updated-dependencies:
- dependency-name: docker/build-push-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-18 04:09:53 +00:00
dependabot[bot]
554c728605
build(deps): bump braces from 3.0.2 to 3.0.3
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-16 13:37:42 +00:00
dependabot[bot]
1c1261e632
build(deps): bump uuid from 9.0.1 to 10.0.0
Bumps [uuid](https://github.com/uuidjs/uuid) from 9.0.1 to 10.0.0.
- [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v9.0.1...v10.0.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-10 04:44:49 +00:00
CrazyMax
5138f76647
Merge pull request from crazy-max/update-dev-deps
chore: update dev dependencies
2024-05-15 14:01:13 +02:00
CrazyMax
eddcf46655
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-15 13:58:48 +02:00
CrazyMax
2740b29678
chore: update dev dependencies
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-15 13:57:47 +02:00
CrazyMax
1113efed2b
Merge pull request from docker/dependabot/npm_and_yarn/docker/actions-toolkit-0.23.0
build(deps): bump @docker/actions-toolkit from 0.20.0 to 0.23.0
2024-05-15 12:11:09 +02:00
CrazyMax
8a2a7ad780
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-15 12:09:16 +02:00
dependabot[bot]
e3c7deb79b
build(deps): bump @docker/actions-toolkit from 0.20.0 to 0.23.0
Bumps [@docker/actions-toolkit](https://github.com/docker/actions-toolkit) from 0.20.0 to 0.23.0.
- [Release notes](https://github.com/docker/actions-toolkit/releases)
- [Commits](https://github.com/docker/actions-toolkit/compare/v0.20.0...v0.23.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>
2024-05-15 04:12:14 +00:00
CrazyMax
be3701b211
Merge pull request from crazy-max/update-yarn
update to yarn 3.6.3
2024-05-07 15:48:31 +02:00
CrazyMax
e2ed622d10
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-07 15:46:36 +02:00
CrazyMax
b73b950903
chore: add plugin-interactive-tools yarn pkg
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-07 15:44:37 +02:00
CrazyMax
157d6d0106
update to yarn 3.6.3
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-05-07 15:43:51 +02:00
Tõnis Tiigi
a530e948ad
Merge pull request from crazy-max/fix-err-output
throw error message instead of exit code
2024-04-15 16:53:40 -07:00
CrazyMax
28ecb964cd
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-12 12:22:12 +02:00
CrazyMax
dc25d8b2ee
throw error message instead of exit code
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-12 12:22:01 +02:00
Tõnis Tiigi
d70bba72b1
Merge pull request from crazy-max/bump-toolkit
bump @docker/actions-toolkit from 0.19.0 to 0.20.0
2024-04-04 09:52:13 -07:00
CrazyMax
7638634cb7
chore: update generated content
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-02 10:45:45 +02:00
CrazyMax
c68420fe0b
bump @docker/actions-toolkit from 0.19.0 to 0.20.0
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
2024-04-02 10:44:53 +02:00
23 changed files with 9898 additions and 4361 deletions

View file

@ -1,2 +1,12 @@
/coverage
/node_modules
# Dependency directories
node_modules/
jspm_packages/
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

2
.gitattributes vendored
View file

@ -1,2 +1,4 @@
/.yarn/releases/** binary
/.yarn/plugins/** binary
/dist/** linguist-generated=true
/lib/** linguist-generated=true

View file

@ -5,6 +5,7 @@ concurrency:
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: '0 10 * * *'
push:
@ -25,8 +26,9 @@ jobs:
- ""
- "latest"
- "v0.4.1"
- "cloud:latest"
- "cloud:v0.11.2-desktop.2"
- "lab:latest"
- "lab:v0.11.2-desktop.2"
steps:
-
name: Checkout
@ -108,7 +110,7 @@ jobs:
buildkitd-flags: --debug
-
name: Build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64,linux/ppc64le
@ -254,7 +256,7 @@ jobs:
buildkitd-config: /tmp/buildkitd.toml
-
name: Build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
@ -281,7 +283,7 @@ jobs:
mirrors = ["mirror.gcr.io"]
-
name: Build
uses: docker/build-push-action@v5
uses: docker/build-push-action@v6
with:
context: .
@ -515,7 +517,7 @@ jobs:
cleanup: ${{ matrix.cleanup }}
k3s:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
@ -528,9 +530,7 @@ jobs:
uses: actions/checkout@v4
-
name: Install k3s
uses: crazy-max/.github/.github/actions/install-k3s@605d30d5ae97f6680578ace4b56645af79343e60
with:
version: "v1.21.2-k3s1"
uses: crazy-max/.github/.github/actions/install-k3s@f5cb4a109b7a3b466a2ac293ef4bb13f1571acd7
-
name: Set up Docker Buildx
id: buildx
@ -582,3 +582,24 @@ jobs:
with:
version: v0.11.2
cache-binary: ${{ matrix.cache }}
windows-error:
runs-on: windows-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set up Docker Buildx
id: buildx
continue-on-error: true
uses: ./
-
name: Check
run: |
echo "${{ toJson(steps.buildx) }}"
if [ "${{ steps.buildx.outcome }}" != "failure" ] || [ "${{ steps.buildx.conclusion }}" != "success" ]; then
echo "::error::Should have failed"
exit 1
fi
shell: bash

21
.github/workflows/publish.yml vendored Normal file
View file

@ -0,0 +1,21 @@
name: publish
on:
release:
types:
- published
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
packages: write
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Publish
uses: actions/publish-immutable-action@v0.0.4

View file

@ -23,12 +23,12 @@ jobs:
uses: ./
-
name: Test
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
targets: test
-
name: Upload coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
file: ./coverage/clover.xml
files: ./coverage/clover.xml
token: ${{ secrets.CODECOV_TOKEN }}

View file

@ -15,16 +15,17 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
targets: ${{ steps.targets.outputs.matrix }}
targets: ${{ steps.generate.outputs.targets }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Targets matrix
id: targets
run: |
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
name: List targets
id: generate
uses: docker/bake-action/subaction/list-targets@v6
with:
target: validate
validate:
runs-on: ubuntu-latest
@ -35,11 +36,8 @@ jobs:
matrix:
target: ${{ fromJson(needs.prepare.outputs.targets) }}
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Validate
uses: docker/bake-action@v4
uses: docker/bake-action@v6
with:
targets: ${{ matrix.target }}

71
.gitignore vendored
View file

@ -1,12 +1,5 @@
/.dev
node_modules
lib
# https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
# Jetbrains
/.idea
/*.iml
# Rest of the file pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
*.log
@ -14,6 +7,7 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
@ -24,34 +18,14 @@ pids
*.seed
*.pid.lock
# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov
# Coverage directory used by tools like istanbul
coverage
*.lcov
# nyc test coverage
.nyc_output
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
# Bower dependency directory (https://bower.io/)
bower_components
# node-waf configuration
.lock-wscript
# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release
# Dependency directories
node_modules/
jspm_packages/
# TypeScript v1 declaration files
typings/
# TypeScript cache
*.tsbuildinfo
@ -61,36 +35,19 @@ typings/
# Optional eslint cache
.eslintcache
# Optional REPL history
.node_repl_history
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# dotenv environment variables file
# dotenv environment variable files
.env
.env.test
.env.development.local
.env.test.local
.env.production.local
.env.local
# parcel-bundler cache (https://parceljs.org/)
.cache
# next.js build output
.next
# nuxt.js build output
.nuxt
# vuepress build output
.vuepress/dist
# Serverless directories
.serverless/
# FuseBox cache
.fusebox/
# DynamoDB Local files
.dynamodb/
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

6
.prettierignore Normal file
View file

@ -0,0 +1,6 @@
# Dependency directories
node_modules/
jspm_packages/
# yarn v2
.yarn/

File diff suppressed because one or more lines are too long

13
.yarnrc.yml Normal file
View file

@ -0,0 +1,13 @@
logFilters:
- code: YN0013
level: discard
- code: YN0019
level: discard
- code: YN0076
level: discard
nodeLinker: node-modules
plugins:
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
spec: "@yarnpkg/plugin-interactive-tools"

View file

@ -101,7 +101,13 @@ The following inputs can be used as `step.with` keys:
| `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_
> [!IMPORTANT]
> If you set the `buildkitd-flags` input, the default flags (`--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host`)
> will be reset. If you want to retain the default behavior, make sure to
> include these flags in your custom `buildkitd-flags` value.
> [!NOTE]
> `buildkitd-config` and `buildkitd-config-inline` are mutually exclusive.
### outputs

View file

@ -1,12 +1,11 @@
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 {Node} from '@docker/actions-toolkit/lib/types/buildx/builder';
import * as context from '../src/context';
@ -26,8 +25,12 @@ jest.spyOn(Context, 'tmpName').mockImplementation((): string => {
return tmpName;
});
jest.mock('uuid');
jest.spyOn(uuid, 'v4').mockReturnValue('9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d');
jest.mock('crypto', () => {
return {
...(jest.requireActual('crypto') as object),
randomUUID: jest.fn(() => '9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d')
};
});
jest.spyOn(Docker, 'context').mockImplementation((): Promise<string> => {
return Promise.resolve('default');
@ -226,6 +229,24 @@ describe('getCreateArgs', () => {
'--buildkitd-flags', '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
'--config', tmpName,
]
],
[
10,
'v0.10.3',
new Map<string, string>([
['install', 'false'],
['use', 'false'],
['driver', 'cloud'],
['buildkitd-flags', '--allow-insecure-entitlement network.host'],
['cache-binary', 'true'],
['cleanup', 'true'],
]),
[
'create',
'--name', 'builder-9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d',
'--driver', 'cloud',
'--buildkitd-flags', '--allow-insecure-entitlement network.host',
]
]
])(
'[%d] given buildx %s and %p as inputs, returns %p',
@ -302,6 +323,140 @@ describe('getAppendArgs', () => {
);
});
describe('getVersion', () => {
beforeEach(() => {
process.env = Object.keys(process.env).reduce((object, key) => {
if (!key.startsWith('INPUT_')) {
object[key] = process.env[key];
}
return object;
}, {});
});
// prettier-ignore
test.each([
[
0,
new Map<string, string>([
// defaults
['install', 'false'],
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true'],
]),
''
],
[
1,
new Map<string, string>([
['version', 'latest'],
// defaults
['install', 'false'],
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true']
]),
'latest'
],
[
2,
new Map<string, string>([
['version', 'edge'],
// defaults
['install', 'false'],
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true']
]),
'edge'
],
[
3,
new Map<string, string>([
['version', 'v0.19.2'],
// defaults
['install', 'false'],
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true']
]),
'v0.19.2'
],
[
4,
new Map<string, string>([
['version', 'latest'],
['driver', 'cloud'],
// defaults
['install', 'false'],
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true']
]),
'cloud:latest'
],
[
5,
new Map<string, string>([
['version', 'edge'],
['driver', 'cloud'],
// defaults
['install', 'false'],
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true']
]),
'cloud:edge'
],
[
6,
new Map<string, string>([
['driver', 'cloud'],
// defaults
['install', 'false'],
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true'],
]),
'cloud:latest'
],
[
7,
new Map<string, string>([
['version', 'cloud:v0.11.2-desktop.2'],
['driver', 'cloud'],
// defaults
['install', 'false'],
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true'],
]),
'cloud:v0.11.2-desktop.2'
],
[
8,
new Map<string, string>([
['version', 'cloud:v0.11.2-desktop.2'],
// defaults
['install', 'false'],
['use', 'true'],
['cache-binary', 'true'],
['cleanup', 'true'],
]),
'cloud:v0.11.2-desktop.2'
],
])(
'[%d] given %p as inputs, returns version %p',
async (num: number, inputs: Map<string, string>, expected: string) => {
inputs.forEach((value: string, name: string) => {
setInput(name, value);
});
const inp = await context.getInputs();
expect(context.getVersion(inp)).toEqual(expected);
}
);
});
// See: https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L67
function getInputName(name: string): string {
return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;

View file

@ -19,7 +19,6 @@ inputs:
required: false
buildkitd-flags:
description: 'BuildKit daemon flags'
default: '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host'
required: false
buildkitd-config:
description: 'BuildKit daemon config file'
@ -52,7 +51,7 @@ inputs:
description: 'Cleanup temp files and remove builder at the end of a job'
default: 'true'
required: false
# deprecated inputs
# TODO: remove deprecated config and config-inline inputs
config:
description: 'BuildKit daemon config file'
deprecationMessage: 'Use buildkitd-config instead'

View file

@ -5,9 +5,16 @@ ARG NODE_VERSION=20
FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache cpio findutils git
WORKDIR /src
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache <<EOT
corepack enable
yarn --version
yarn config set --home enableTelemetry 0
EOT
FROM base AS deps
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn install && mkdir /vendor && cp yarn.lock /vendor
@ -16,18 +23,19 @@ COPY --from=deps /vendor /
FROM deps AS vendor-validate
RUN --mount=type=bind,target=.,rw <<EOT
set -e
git add -A
cp -rf /vendor/* .
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
git status --porcelain -- yarn.lock
exit 1
fi
set -e
git add -A
cp -rf /vendor/* .
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor"'
git status --porcelain -- yarn.lock
exit 1
fi
EOT
FROM deps AS build
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run build && mkdir /out && cp -Rf dist /out/
@ -36,34 +44,35 @@ COPY --from=build /out /
FROM build AS build-validate
RUN --mount=type=bind,target=.,rw <<EOT
set -e
git add -A
cp -rf /out/* .
if [ -n "$(git status --porcelain -- dist)" ]; then
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
git status --porcelain -- dist
exit 1
fi
set -e
git add -A
cp -rf /out/* .
if [ -n "$(git status --porcelain -- dist)" ]; then
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
git status --porcelain -- dist
exit 1
fi
EOT
FROM deps AS format
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run format \
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' -not -path './.yarn/*' | cpio -pdm /out
FROM scratch AS format-update
COPY --from=format /out /
FROM deps AS lint
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run lint
FROM deps AS test
ENV RUNNER_TEMP=/tmp/github_runner
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/.yarn/cache \
--mount=type=cache,target=/src/node_modules \
yarn run test --coverage --coverageDirectory=/tmp/coverage

87
dist/index.js generated vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map generated vendored

File diff suppressed because one or more lines are too long

2038
dist/licenses.txt generated vendored

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,15 @@
target "_common" {
args = {
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
}
}
group "default" {
targets = ["build"]
}
group "pre-checkin" {
targets = ["vendor-update", "format", "build"]
targets = ["vendor", "format", "build"]
}
group "validate" {
@ -11,42 +17,49 @@ group "validate" {
}
target "build" {
inherits = ["_common"]
dockerfile = "dev.Dockerfile"
target = "build-update"
output = ["."]
}
target "build-validate" {
inherits = ["_common"]
dockerfile = "dev.Dockerfile"
target = "build-validate"
output = ["type=cacheonly"]
}
target "format" {
inherits = ["_common"]
dockerfile = "dev.Dockerfile"
target = "format-update"
output = ["."]
}
target "lint" {
inherits = ["_common"]
dockerfile = "dev.Dockerfile"
target = "lint"
output = ["type=cacheonly"]
}
target "vendor-update" {
target "vendor" {
inherits = ["_common"]
dockerfile = "dev.Dockerfile"
target = "vendor-update"
output = ["."]
}
target "vendor-validate" {
inherits = ["_common"]
dockerfile = "dev.Dockerfile"
target = "vendor-validate"
output = ["type=cacheonly"]
}
target "test" {
inherits = ["_common"]
dockerfile = "dev.Dockerfile"
target = "test-coverage"
output = ["./coverage"]

View file

@ -1,17 +1,16 @@
{
"name": "docker-setup-buildx",
"description": "Set up Docker Buildx",
"main": "lib/main.js",
"main": "src/main.ts",
"scripts": {
"build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
"build": "ncc build --source-map --minify --license licenses.txt",
"lint": "yarn run prettier && yarn run eslint",
"format": "yarn run prettier:fix && yarn run eslint:fix",
"eslint": "eslint --max-warnings=0 .",
"eslint:fix": "eslint --fix .",
"prettier": "prettier --check \"./**/*.ts\"",
"prettier:fix": "prettier --write \"./**/*.ts\"",
"test": "jest",
"all": "yarn run build && yarn run format && yarn test"
"test": "jest"
},
"repository": {
"type": "git",
@ -24,26 +23,27 @@
],
"author": "Docker Inc.",
"license": "Apache-2.0",
"packageManager": "yarn@3.6.3",
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/exec": "^1.1.1",
"@docker/actions-toolkit": "^0.19.0",
"js-yaml": "^4.1.0",
"uuid": "^9.0.1"
"@actions/core": "^1.11.1",
"@docker/actions-toolkit": "^0.56.0",
"js-yaml": "^4.1.0"
},
"devDependencies": {
"@types/node": "^20.5.9",
"@typescript-eslint/eslint-plugin": "^6.6.0",
"@typescript-eslint/parser": "^6.6.0",
"@vercel/ncc": "^0.38.0",
"eslint": "^8.48.0",
"eslint-config-prettier": "^9.0.0",
"eslint-plugin-jest": "^27.2.3",
"eslint-plugin-prettier": "^5.0.0",
"jest": "^29.6.4",
"prettier": "^3.0.3",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
"@types/js-yaml": "^4.0.9",
"@types/node": "^20.12.12",
"@types/uuid": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"@vercel/ncc": "^0.38.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^28.5.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"prettier": "^3.2.5",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"typescript": "^5.4.5"
}
}

View file

@ -1,11 +1,14 @@
import * as uuid from 'uuid';
import * as crypto from 'crypto';
import * as core from '@actions/core';
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
import {Util} from '@docker/actions-toolkit/lib/util';
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
import {Node} from '@docker/actions-toolkit/lib/types/builder';
import {Node} from '@docker/actions-toolkit/lib/types/buildx/builder';
export const builderNodeEnvPrefix = 'BUILDER_NODE';
const defaultBuildkitdFlags = '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host';
export interface Inputs {
version: string;
@ -30,7 +33,7 @@ export async function getInputs(): Promise<Inputs> {
name: await getBuilderName(core.getInput('driver') || 'docker-container'),
driver: core.getInput('driver') || 'docker-container',
driverOpts: Util.getInputList('driver-opts', {ignoreComma: true, quote: false}),
buildkitdFlags: core.getInput('buildkitd-flags') || '--allow-insecure-entitlement security.insecure --allow-insecure-entitlement network.host',
buildkitdFlags: core.getInput('buildkitd-flags'),
platforms: Util.getInputList('platforms'),
install: core.getBooleanInput('install'),
use: core.getBooleanInput('use'),
@ -44,17 +47,19 @@ export async function getInputs(): Promise<Inputs> {
}
export async function getBuilderName(driver: string): Promise<string> {
return driver == 'docker' ? await Docker.context() : `builder-${uuid.v4()}`;
return driver == 'docker' ? await Docker.context() : `builder-${crypto.randomUUID()}`;
}
export async function getCreateArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
const args: Array<string> = ['create', '--name', inputs.name, '--driver', inputs.driver];
if (await toolkit.buildx.versionSatisfies('>=0.3.0')) {
await Util.asyncForEach(inputs.driverOpts, async driverOpt => {
await Util.asyncForEach(inputs.driverOpts, async (driverOpt: string) => {
args.push('--driver-opt', driverOpt);
});
if (driverSupportsFlags(inputs.driver) && inputs.buildkitdFlags) {
if (inputs.buildkitdFlags) {
args.push('--buildkitd-flags', inputs.buildkitdFlags);
} else if (driverSupportsBuildkitdFlags(inputs.driver)) {
args.push('--buildkitd-flags', defaultBuildkitdFlags);
}
}
if (inputs.platforms.length > 0) {
@ -63,12 +68,10 @@ export async function getCreateArgs(inputs: Inputs, toolkit: Toolkit): Promise<A
if (inputs.use) {
args.push('--use');
}
if (driverSupportsFlags(inputs.driver)) {
if (inputs.buildkitdConfig) {
args.push('--config', toolkit.buildkit.config.resolveFromFile(inputs.buildkitdConfig));
} else if (inputs.buildkitdConfigInline) {
args.push('--config', toolkit.buildkit.config.resolveFromString(inputs.buildkitdConfigInline));
}
if (inputs.buildkitdConfig) {
args.push('--config', toolkit.buildkit.config.resolveFromFile(inputs.buildkitdConfig));
} else if (inputs.buildkitdConfigInline) {
args.push('--config', toolkit.buildkit.config.resolveFromString(inputs.buildkitdConfigInline));
}
if (inputs.endpoint) {
args.push(inputs.endpoint);
@ -81,14 +84,16 @@ export async function getAppendArgs(inputs: Inputs, node: Node, toolkit: Toolkit
if (node.name) {
args.push('--node', node.name);
} else if (inputs.driver == 'kubernetes' && (await toolkit.buildx.versionSatisfies('<0.11.0'))) {
args.push('--node', `node-${uuid.v4()}`);
args.push('--node', `node-${crypto.randomUUID()}`);
}
if (node['driver-opts'] && (await toolkit.buildx.versionSatisfies('>=0.3.0'))) {
await Util.asyncForEach(node['driver-opts'], async driverOpt => {
await Util.asyncForEach(node['driver-opts'], async (driverOpt: string) => {
args.push('--driver-opt', driverOpt);
});
if (driverSupportsFlags(inputs.driver) && node['buildkitd-flags']) {
if (node['buildkitd-flags']) {
args.push('--buildkitd-flags', node['buildkitd-flags']);
} else if (driverSupportsBuildkitdFlags(inputs.driver)) {
args.push('--buildkitd-flags', defaultBuildkitdFlags);
}
}
if (node.platforms) {
@ -108,6 +113,20 @@ export async function getInspectArgs(inputs: Inputs, toolkit: Toolkit): Promise<
return args;
}
function driverSupportsFlags(driver: string): boolean {
function driverSupportsBuildkitdFlags(driver: string): boolean {
return driver == '' || driver == 'docker-container' || driver == 'docker' || driver == 'kubernetes';
}
export function getVersion(inputs: Inputs): string {
const version = inputs.version;
if (inputs.driver === 'cloud') {
if (!version || version === 'latest') {
return 'cloud:latest';
}
if (version.startsWith('cloud:') || version.startsWith('lab:')) {
return version;
}
return `cloud:${version}`;
}
return version;
}

View file

@ -1,14 +1,18 @@
import * as crypto from 'crypto';
import * as fs from 'fs';
import * as yaml from 'js-yaml';
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as actionsToolkit from '@docker/actions-toolkit';
import {Buildx} from '@docker/actions-toolkit/lib/buildx/buildx';
import {Builder} from '@docker/actions-toolkit/lib/buildx/builder';
import {Docker} from '@docker/actions-toolkit/lib/docker/docker';
import {Exec} from '@docker/actions-toolkit/lib/exec';
import {Toolkit} from '@docker/actions-toolkit/lib/toolkit';
import {Util} from '@docker/actions-toolkit/lib/util';
import {Node} from '@docker/actions-toolkit/lib/types/builder';
import {Node} from '@docker/actions-toolkit/lib/types/buildx/builder';
import {ContextInfo} from '@docker/actions-toolkit/lib/types/docker/docker';
import * as context from './context';
import * as stateHelper from './state-helper';
@ -18,6 +22,7 @@ actionsToolkit.run(
async () => {
const inputs: context.Inputs = await context.getInputs();
stateHelper.setCleanup(inputs.cleanup);
const version = context.getVersion(inputs);
const toolkit = new Toolkit();
const standalone = await toolkit.buildx.isStandalone();
@ -33,16 +38,16 @@ actionsToolkit.run(
});
let toolPath;
if (Util.isValidRef(inputs.version)) {
if (Util.isValidRef(version)) {
if (standalone) {
throw new Error(`Cannot build from source without the Docker CLI`);
}
await core.group(`Build buildx from source`, async () => {
toolPath = await toolkit.buildxInstall.build(inputs.version, !inputs.cacheBinary);
toolPath = await toolkit.buildxInstall.build(version, !inputs.cacheBinary);
});
} else if (!(await toolkit.buildx.isAvailable()) || inputs.version) {
} else if (!(await toolkit.buildx.isAvailable()) || version) {
await core.group(`Download buildx from GitHub Releases`, async () => {
toolPath = await toolkit.buildxInstall.download(inputs.version || 'latest', !inputs.cacheBinary);
toolPath = await toolkit.buildxInstall.download(version || 'latest', !inputs.cacheBinary);
});
}
if (toolPath) {
@ -66,6 +71,51 @@ actionsToolkit.run(
fs.mkdirSync(Buildx.certsDir, {recursive: true});
stateHelper.setCertsDir(Buildx.certsDir);
// if the default context has TLS data loaded and endpoint is not set, then
// we create a temporary docker context only if driver is docker-container
// https://github.com/docker/buildx/blob/b96ad59f64d40873e4959336d294b648bb3937fe/builder/builder.go#L489
// https://github.com/docker/setup-buildx-action/issues/105
if (!standalone && inputs.driver == 'docker-container' && (await Docker.context()) == 'default' && inputs.endpoint.length == 0) {
let defaultContextWithTLS: boolean = false;
await core.group(`Inspecting default docker context`, async () => {
await Docker.getExecOutput(['context', 'inspect', '--format=json', 'default'], {
ignoreReturnCode: true,
silent: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.info(`Cannot inspect default docker context: ${res.stderr.trim()}`);
} else {
try {
const contextInfo = (<Array<ContextInfo>>JSON.parse(res.stdout.trim()))[0];
core.info(JSON.stringify(JSON.parse(res.stdout.trim()), undefined, 2));
const hasTLSData = Object.keys(contextInfo.Endpoints).length > 0 && Object.values(contextInfo.Endpoints)[0].TLSData !== undefined;
const hasTLSMaterial = Object.keys(contextInfo.TLSMaterial).length > 0 && Object.values(contextInfo.TLSMaterial)[0].length > 0;
defaultContextWithTLS = hasTLSData || hasTLSMaterial;
} catch (e) {
core.info(`Unable to parse default docker context info: ${e}`);
core.info(res.stdout.trim());
}
}
});
});
if (defaultContextWithTLS) {
const tmpDockerContext = `buildx-${crypto.randomUUID()}`;
await core.group(`Creating temp docker context (TLS data loaded in default one)`, async () => {
await Docker.getExecOutput(['context', 'create', tmpDockerContext], {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.warning(`Cannot create docker context ${tmpDockerContext}: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
} else {
core.info(`Setting builder endpoint to ${tmpDockerContext} context`);
inputs.endpoint = tmpDockerContext;
stateHelper.setTmpDockerContext(tmpDockerContext);
}
});
});
}
}
if (inputs.driver !== 'docker') {
await core.group(`Creating a new builder instance`, async () => {
const certsDriverOpts = Buildx.resolveCertsDriverOpts(inputs.driver, inputs.endpoint, {
@ -77,7 +127,13 @@ actionsToolkit.run(
inputs.driverOpts = [...inputs.driverOpts, ...certsDriverOpts];
}
const createCmd = await toolkit.buildx.getCommand(await context.getCreateArgs(inputs, toolkit));
await exec.exec(createCmd.command, createCmd.args);
await Exec.getExecOutput(createCmd.command, createCmd.args, {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
}
});
});
}
@ -95,7 +151,13 @@ actionsToolkit.run(
node['driver-opts'] = [...(node['driver-opts'] || []), ...certsDriverOpts];
}
const appendCmd = await toolkit.buildx.getCommand(await context.getAppendArgs(inputs, node, toolkit));
await exec.exec(appendCmd.command, appendCmd.args);
await Exec.getExecOutput(appendCmd.command, appendCmd.args, {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(`Failed to append node ${node.name}: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
}
});
nodeIndex++;
}
});
@ -103,7 +165,13 @@ actionsToolkit.run(
await core.group(`Booting builder`, async () => {
const inspectCmd = await toolkit.buildx.getCommand(await context.getInspectArgs(inputs, toolkit));
await exec.exec(inspectCmd.command, inspectCmd.args);
await Exec.getExecOutput(inspectCmd.command, inspectCmd.args, {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
}
});
});
if (inputs.install) {
@ -112,7 +180,13 @@ actionsToolkit.run(
}
await core.group(`Setting buildx as default builder`, async () => {
const installCmd = await toolkit.buildx.getCommand(['install']);
await exec.exec(installCmd.command, installCmd.args);
await Exec.getExecOutput(installCmd.command, installCmd.args, {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
}
});
});
}
@ -155,15 +229,13 @@ actionsToolkit.run(
async () => {
if (stateHelper.IsDebug && stateHelper.containerName.length > 0) {
await core.group(`BuildKit container logs`, async () => {
await exec
.getExecOutput('docker', ['logs', `${stateHelper.containerName}`], {
ignoreReturnCode: true
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.warning(res.stderr.trim());
}
});
await Docker.getExecOutput(['logs', `${stateHelper.containerName}`], {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.warning(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
}
});
});
}
@ -177,21 +249,31 @@ actionsToolkit.run(
const builder = new Builder({buildx: buildx});
if (await builder.exists(stateHelper.builderName)) {
const rmCmd = await buildx.getCommand(['rm', stateHelper.builderName]);
await exec
.getExecOutput(rmCmd.command, rmCmd.args, {
ignoreReturnCode: true
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.warning(res.stderr.trim());
}
});
await Exec.getExecOutput(rmCmd.command, rmCmd.args, {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.warning(res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error');
}
});
} else {
core.info(`${stateHelper.builderName} does not exist`);
}
});
}
if (stateHelper.tmpDockerContext) {
await core.group(`Removing temp docker context`, async () => {
await Exec.getExecOutput('docker', ['context', 'rm', '-f', stateHelper.tmpDockerContext], {
ignoreReturnCode: true
}).then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
core.warning(`${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
}
});
});
}
if (stateHelper.certsDir.length > 0 && fs.existsSync(stateHelper.certsDir)) {
await core.group(`Cleaning up certificates`, async () => {
fs.rmSync(stateHelper.certsDir, {recursive: true});

View file

@ -6,6 +6,7 @@ export const builderName = process.env['STATE_builderName'] || '';
export const builderDriver = process.env['STATE_builderDriver'] || '';
export const containerName = process.env['STATE_containerName'] || '';
export const certsDir = process.env['STATE_certsDir'] || '';
export const tmpDockerContext = process.env['STATE_tmpDockerContext'] || '';
export const cleanup = /true/i.test(process.env['STATE_cleanup'] || '');
export function setDebug(debug: string) {
@ -32,6 +33,10 @@ export function setCertsDir(certsDir: string) {
core.saveState('certsDir', certsDir);
}
export function setTmpDockerContext(tmpDockerContext: string) {
core.saveState('tmpDockerContext', tmpDockerContext);
}
export function setCleanup(cleanup: boolean) {
core.saveState('cleanup', cleanup);
}

10931
yarn.lock

File diff suppressed because it is too large Load diff