mirror of
https://github.com/docker/setup-qemu-action.git
synced 2025-11-07 07:56:55 +00:00
Compare commits
65 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c7c5346462 | ||
|
|
3a517a1a6f | ||
|
|
a5b45edf7e | ||
|
|
3a64278e93 | ||
|
|
94906ba253 | ||
|
|
4027abfd67 | ||
|
|
bee0aaad0f | ||
|
|
0d7e25756e | ||
|
|
b86960130e | ||
|
|
3a043edff3 | ||
|
|
7ce6cde3fb | ||
|
|
801c7ff061 | ||
|
|
46e6051a4d | ||
|
|
8e42949624 | ||
|
|
69a60f36e3 | ||
|
|
a086e65697 | ||
|
|
5d29132711 | ||
|
|
2c4e2c9c86 | ||
|
|
76c9b61130 | ||
|
|
e77e8065d9 | ||
|
|
646f117836 | ||
|
|
3320a6b3fe | ||
|
|
e88307919d | ||
|
|
05340d1c67 | ||
|
|
2c50240b0c | ||
|
|
914cee9a9c | ||
|
|
737ba1e397 | ||
|
|
7a388d81f1 | ||
|
|
5a7ea16bc4 | ||
|
|
a2fd8cfed3 | ||
|
|
fcd3152d8a | ||
|
|
6bc7671629 | ||
|
|
29109295f8 | ||
|
|
7ffe24aa9a | ||
|
|
17bc18bb05 | ||
|
|
5964de0df5 | ||
|
|
862b6633f8 | ||
|
|
138de3b646 | ||
|
|
4574d27a47 | ||
|
|
7a38281c35 | ||
|
|
7a1c63f9e5 | ||
|
|
2825a1268f | ||
|
|
f30d974279 | ||
|
|
568bf0683b | ||
|
|
a1aad7b5f5 | ||
|
|
e5daf5da4e | ||
|
|
faec242d1f | ||
|
|
53851d1459 | ||
|
|
7066b9044f | ||
|
|
75590814eb | ||
|
|
08d11eb481 | ||
|
|
e53506fe6c | ||
|
|
610b4428f9 | ||
|
|
58a19f851c | ||
|
|
49a12c4cc8 | ||
|
|
2b8ac83d96 | ||
|
|
fdbeaac5ff | ||
|
|
c3bed4ec62 | ||
|
|
0d7f78d53b | ||
|
|
4556918418 | ||
|
|
e267f33184 | ||
|
|
8b562efa09 | ||
|
|
2f493fa515 | ||
|
|
719c55c4a5 | ||
|
|
0d9790b125 |
20 changed files with 2846 additions and 2923 deletions
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
|
|
@ -14,7 +14,7 @@ to the public under the [project's open source license](LICENSE).
|
||||||
5. Format code and build javascript artifacts: `docker buildx bake pre-checkin`
|
5. Format code and build javascript artifacts: `docker buildx bake pre-checkin`
|
||||||
6. Validate all code has correctly formatted and built: `docker buildx bake validate`
|
6. Validate all code has correctly formatted and built: `docker buildx bake validate`
|
||||||
7. Push to your fork and [submit a pull request](https://github.com/docker/setup-qemu-action/compare)
|
7. Push to your fork and [submit a pull request](https://github.com/docker/setup-qemu-action/compare)
|
||||||
8. Pat your self on the back and wait for your pull request to be reviewed and merged.
|
8. Pat yourself on the back and wait for your pull request to be reviewed and merged.
|
||||||
|
|
||||||
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
|
Here are a few things you can do that will increase the likelihood of your pull request being accepted:
|
||||||
|
|
||||||
|
|
|
||||||
49
.github/workflows/ci.yml
vendored
49
.github/workflows/ci.yml
vendored
|
|
@ -5,6 +5,7 @@ concurrency:
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 10 * * *'
|
- cron: '0 10 * * *'
|
||||||
push:
|
push:
|
||||||
|
|
@ -21,7 +22,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
id: qemu
|
id: qemu
|
||||||
|
|
@ -44,7 +45,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
-
|
-
|
||||||
name: Set up QEMU
|
name: Set up QEMU
|
||||||
id: qemu
|
id: qemu
|
||||||
|
|
@ -61,7 +62,7 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
-
|
-
|
||||||
name: Stop docker
|
name: Stop docker
|
||||||
run: |
|
run: |
|
||||||
|
|
@ -79,3 +80,45 @@ jobs:
|
||||||
echo "::error::Should have failed"
|
echo "::error::Should have failed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
cache-image:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
cache:
|
||||||
|
- true
|
||||||
|
- false
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
id: qemu
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
image: tonistiigi/binfmt:master
|
||||||
|
cache-image: ${{ matrix.cache }}
|
||||||
|
-
|
||||||
|
name: Available platforms
|
||||||
|
run: echo ${{ steps.qemu.outputs.platforms }}
|
||||||
|
|
||||||
|
version:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
image:
|
||||||
|
- tonistiigi/binfmt:master
|
||||||
|
- tonistiigi/binfmt:latest
|
||||||
|
- tonistiigi/binfmt:qemu-v7.0.0
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v5
|
||||||
|
-
|
||||||
|
name: Set up QEMU
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
image: ${{ matrix.image }}
|
||||||
|
|
|
||||||
17
.github/workflows/pr-assign-author.yml
vendored
Normal file
17
.github/workflows/pr-assign-author.yml
vendored
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
name: pr-assign-author
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request_target:
|
||||||
|
types:
|
||||||
|
- opened
|
||||||
|
- reopened
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
run:
|
||||||
|
uses: crazy-max/.github/.github/workflows/pr-assign-author.yml@1b673f36fad86812f538c1df9794904038a23cbf
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
pull-requests: write
|
||||||
21
.github/workflows/publish.yml
vendored
Normal file
21
.github/workflows/publish.yml
vendored
Normal 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@v5
|
||||||
|
-
|
||||||
|
name: Publish
|
||||||
|
uses: actions/publish-immutable-action@v0.0.4
|
||||||
9
.github/workflows/test.yml
vendored
9
.github/workflows/test.yml
vendored
|
|
@ -17,15 +17,16 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
-
|
-
|
||||||
name: Test
|
name: Test
|
||||||
uses: docker/bake-action@v5
|
uses: docker/bake-action@v6
|
||||||
with:
|
with:
|
||||||
|
source: .
|
||||||
targets: test
|
targets: test
|
||||||
-
|
-
|
||||||
name: Upload coverage
|
name: Upload coverage
|
||||||
uses: codecov/codecov-action@v4
|
uses: codecov/codecov-action@v5
|
||||||
with:
|
with:
|
||||||
file: ./coverage/clover.xml
|
files: ./coverage/clover.xml
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
|
||||||
18
.github/workflows/validate.yml
vendored
18
.github/workflows/validate.yml
vendored
|
|
@ -15,16 +15,17 @@ jobs:
|
||||||
prepare:
|
prepare:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
targets: ${{ steps.targets.outputs.matrix }}
|
targets: ${{ steps.generate.outputs.targets }}
|
||||||
steps:
|
steps:
|
||||||
-
|
-
|
||||||
name: Checkout
|
name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
-
|
-
|
||||||
name: Targets matrix
|
name: List targets
|
||||||
id: targets
|
id: generate
|
||||||
run: |
|
uses: docker/bake-action/subaction/list-targets@v6
|
||||||
echo "matrix=$(docker buildx bake validate --print | jq -cr '.group.validate.targets')" >> $GITHUB_OUTPUT
|
with:
|
||||||
|
target: validate
|
||||||
|
|
||||||
validate:
|
validate:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
@ -35,11 +36,8 @@ jobs:
|
||||||
matrix:
|
matrix:
|
||||||
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
target: ${{ fromJson(needs.prepare.outputs.targets) }}
|
||||||
steps:
|
steps:
|
||||||
-
|
|
||||||
name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
-
|
-
|
||||||
name: Validate
|
name: Validate
|
||||||
uses: docker/bake-action@v5
|
uses: docker/bake-action@v6
|
||||||
with:
|
with:
|
||||||
targets: ${{ matrix.target }}
|
targets: ${{ matrix.target }}
|
||||||
|
|
|
||||||
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
File diff suppressed because one or more lines are too long
12
.yarnrc.yml
12
.yarnrc.yml
|
|
@ -1,3 +1,9 @@
|
||||||
|
# https://yarnpkg.com/configuration/yarnrc
|
||||||
|
|
||||||
|
compressionLevel: mixed
|
||||||
|
enableGlobalCache: false
|
||||||
|
enableHardenedMode: true
|
||||||
|
|
||||||
logFilters:
|
logFilters:
|
||||||
- code: YN0013
|
- code: YN0013
|
||||||
level: discard
|
level: discard
|
||||||
|
|
@ -5,9 +11,9 @@ logFilters:
|
||||||
level: discard
|
level: discard
|
||||||
- code: YN0076
|
- code: YN0076
|
||||||
level: discard
|
level: discard
|
||||||
|
- code: YN0086
|
||||||
|
level: discard
|
||||||
|
|
||||||
nodeLinker: node-modules
|
nodeLinker: node-modules
|
||||||
|
|
||||||
plugins:
|
npmAuthToken: "${NODE_AUTH_TOKEN:-fallback}"
|
||||||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
|
||||||
spec: "@yarnpkg/plugin-interactive-tools"
|
|
||||||
|
|
|
||||||
22
README.md
22
README.md
|
|
@ -35,16 +35,30 @@ jobs:
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
```
|
```
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> If you are using [`docker/setup-buildx-action`](https://github.com/docker/setup-buildx-action),
|
||||||
|
> this action should come before it:
|
||||||
|
>
|
||||||
|
> ```yaml
|
||||||
|
> -
|
||||||
|
> name: Set up QEMU
|
||||||
|
> uses: docker/setup-qemu-action@v3
|
||||||
|
> -
|
||||||
|
> name: Set up Docker Buildx
|
||||||
|
> uses: docker/setup-buildx-action@v3
|
||||||
|
> ```
|
||||||
|
|
||||||
## Customizing
|
## Customizing
|
||||||
|
|
||||||
### inputs
|
### inputs
|
||||||
|
|
||||||
The following inputs can be used as `step.with` keys:
|
The following inputs can be used as `step.with` keys:
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
|-------------|--------|-------------------------------------------------------------------------------|--------------------------------------------------|
|
|---------------|--------|-------------------------------------------------------------------------------|----------------------------------------------------|
|
||||||
| `image` | String | [`tonistiigi/binfmt:latest`](https://hub.docker.com/r/tonistiigi/binfmt/tags) | QEMU static binaries Docker image |
|
| `image` | String | [`tonistiigi/binfmt:latest`](https://hub.docker.com/r/tonistiigi/binfmt/tags) | QEMU static binaries Docker image |
|
||||||
| `platforms` | String | `all` | Platforms to install (e.g., `arm64,riscv64,arm`) |
|
| `platforms` | String | `all` | Platforms to install (e.g., `arm64,riscv64,arm`) |
|
||||||
|
| `cache-image` | Bool | `true` | Cache binfmt image to GitHub Actions cache backend |
|
||||||
|
|
||||||
### outputs
|
### outputs
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,13 @@ describe('getInputs', () => {
|
||||||
test.each([
|
test.each([
|
||||||
[
|
[
|
||||||
0,
|
0,
|
||||||
new Map<string, string>([]),
|
new Map<string, string>([
|
||||||
|
['cache-image', 'true'],
|
||||||
|
]),
|
||||||
{
|
{
|
||||||
image: 'docker.io/tonistiigi/binfmt:latest',
|
image: 'docker.io/tonistiigi/binfmt:latest',
|
||||||
platforms: 'all',
|
platforms: 'all',
|
||||||
|
cacheImage: true,
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
|
|
@ -27,20 +30,24 @@ describe('getInputs', () => {
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['image', 'docker/binfmt:latest'],
|
['image', 'docker/binfmt:latest'],
|
||||||
['platforms', 'arm64,riscv64,arm'],
|
['platforms', 'arm64,riscv64,arm'],
|
||||||
|
['cache-image', 'false'],
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
image: 'docker/binfmt:latest',
|
image: 'docker/binfmt:latest',
|
||||||
platforms: 'arm64,riscv64,arm',
|
platforms: 'arm64,riscv64,arm',
|
||||||
|
cacheImage: false,
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
2,
|
2,
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['platforms', 'arm64, riscv64, arm '],
|
['platforms', 'arm64, riscv64, arm '],
|
||||||
|
['cache-image', 'true'],
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
image: 'docker.io/tonistiigi/binfmt:latest',
|
image: 'docker.io/tonistiigi/binfmt:latest',
|
||||||
platforms: 'arm64,riscv64,arm',
|
platforms: 'arm64,riscv64,arm',
|
||||||
|
cacheImage: true,
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
]
|
]
|
||||||
])(
|
])(
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,10 @@ inputs:
|
||||||
description: 'Platforms to install (e.g. arm64,riscv64,arm)'
|
description: 'Platforms to install (e.g. arm64,riscv64,arm)'
|
||||||
default: 'all'
|
default: 'all'
|
||||||
required: false
|
required: false
|
||||||
|
cache-image:
|
||||||
|
description: 'Cache binfmt image to GitHub Actions cache backend'
|
||||||
|
default: 'true'
|
||||||
|
required: false
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
platforms:
|
platforms:
|
||||||
|
|
@ -23,3 +27,4 @@ outputs:
|
||||||
runs:
|
runs:
|
||||||
using: 'node20'
|
using: 'node20'
|
||||||
main: 'dist/index.js'
|
main: 'dist/index.js'
|
||||||
|
post: 'dist/index.js'
|
||||||
|
|
|
||||||
42
dist/index.js
generated
vendored
42
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
31
dist/licenses.txt
generated
vendored
31
dist/licenses.txt
generated
vendored
|
|
@ -2358,9 +2358,6 @@ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
|
||||||
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
dot-object
|
|
||||||
MIT
|
|
||||||
|
|
||||||
encoding
|
encoding
|
||||||
MIT
|
MIT
|
||||||
Copyright (c) 2012-2014 Andris Reinman
|
Copyright (c) 2012-2014 Andris Reinman
|
||||||
|
|
@ -2562,31 +2559,6 @@ PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
is-plain-object
|
|
||||||
MIT
|
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2014-2017, Jon Schlinkert.
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in
|
|
||||||
all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
||||||
THE SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
is-stream
|
is-stream
|
||||||
MIT
|
MIT
|
||||||
MIT License
|
MIT License
|
||||||
|
|
@ -3636,9 +3608,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
twirp-ts
|
|
||||||
MIT
|
|
||||||
|
|
||||||
undici
|
undici
|
||||||
MIT
|
MIT
|
||||||
MIT License
|
MIT License
|
||||||
|
|
|
||||||
2
dist/sourcemap-register.js
generated
vendored
2
dist/sourcemap-register.js
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,3 +1,9 @@
|
||||||
|
target "_common" {
|
||||||
|
args = {
|
||||||
|
BUILDKIT_CONTEXT_KEEP_GIT_DIR = 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
group "default" {
|
group "default" {
|
||||||
targets = ["build"]
|
targets = ["build"]
|
||||||
}
|
}
|
||||||
|
|
@ -11,42 +17,49 @@ group "validate" {
|
||||||
}
|
}
|
||||||
|
|
||||||
target "build" {
|
target "build" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "build-update"
|
target = "build-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "build-validate" {
|
target "build-validate" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "build-validate"
|
target = "build-validate"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "format" {
|
target "format" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "format-update"
|
target = "format-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "lint" {
|
target "lint" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "lint"
|
target = "lint"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "vendor" {
|
target "vendor" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "vendor-update"
|
target = "vendor-update"
|
||||||
output = ["."]
|
output = ["."]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "vendor-validate" {
|
target "vendor-validate" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "vendor-validate"
|
target = "vendor-validate"
|
||||||
output = ["type=cacheonly"]
|
output = ["type=cacheonly"]
|
||||||
}
|
}
|
||||||
|
|
||||||
target "test" {
|
target "test" {
|
||||||
|
inherits = ["_common"]
|
||||||
dockerfile = "dev.Dockerfile"
|
dockerfile = "dev.Dockerfile"
|
||||||
target = "test-coverage"
|
target = "test-coverage"
|
||||||
output = ["./coverage"]
|
output = ["./coverage"]
|
||||||
|
|
|
||||||
28
package.json
28
package.json
|
|
@ -23,24 +23,24 @@
|
||||||
],
|
],
|
||||||
"author": "Docker Inc.",
|
"author": "Docker Inc.",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"packageManager": "yarn@3.6.3",
|
"packageManager": "yarn@4.9.2",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.1",
|
"@actions/core": "^1.11.1",
|
||||||
"@docker/actions-toolkit": "^0.35.0"
|
"@docker/actions-toolkit": "^0.67.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^20.12.12",
|
"@types/node": "^20.19.9",
|
||||||
"@typescript-eslint/eslint-plugin": "^7.9.0",
|
"@typescript-eslint/eslint-plugin": "^7.18.0",
|
||||||
"@typescript-eslint/parser": "^7.9.0",
|
"@typescript-eslint/parser": "^7.18.0",
|
||||||
"@vercel/ncc": "^0.38.1",
|
"@vercel/ncc": "^0.38.3",
|
||||||
"eslint": "^8.57.0",
|
"eslint": "^8.57.1",
|
||||||
"eslint-config-prettier": "^9.1.0",
|
"eslint-config-prettier": "^9.1.2",
|
||||||
"eslint-plugin-jest": "^28.5.0",
|
"eslint-plugin-jest": "^28.14.0",
|
||||||
"eslint-plugin-prettier": "^5.1.3",
|
"eslint-plugin-prettier": "^5.5.4",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"prettier": "^3.2.5",
|
"prettier": "^3.6.2",
|
||||||
"ts-jest": "^29.1.2",
|
"ts-jest": "^29.4.1",
|
||||||
"ts-node": "^10.9.2",
|
"ts-node": "^10.9.2",
|
||||||
"typescript": "^5.4.5"
|
"typescript": "^5.9.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,13 @@ import {Util} from '@docker/actions-toolkit/lib/util';
|
||||||
export interface Inputs {
|
export interface Inputs {
|
||||||
image: string;
|
image: string;
|
||||||
platforms: string;
|
platforms: string;
|
||||||
|
cacheImage: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getInputs(): Inputs {
|
export function getInputs(): Inputs {
|
||||||
return {
|
return {
|
||||||
image: core.getInput('image') || 'docker.io/tonistiigi/binfmt:latest',
|
image: core.getInput('image') || 'docker.io/tonistiigi/binfmt:latest',
|
||||||
platforms: Util.getInputList('platforms').join(',') || 'all'
|
platforms: Util.getInputList('platforms').join(',') || 'all',
|
||||||
|
cacheImage: core.getBooleanInput('cache-image')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
10
src/main.ts
10
src/main.ts
|
|
@ -20,7 +20,11 @@ actionsToolkit.run(
|
||||||
});
|
});
|
||||||
|
|
||||||
await core.group(`Pulling binfmt Docker image`, async () => {
|
await core.group(`Pulling binfmt Docker image`, async () => {
|
||||||
await Docker.getExecOutput(['pull', input.image], {
|
await Docker.pull(input.image, input.cacheImage);
|
||||||
|
});
|
||||||
|
|
||||||
|
await core.group(`Image info`, async () => {
|
||||||
|
await Docker.getExecOutput(['image', 'inspect', input.image], {
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
|
|
@ -29,8 +33,8 @@ actionsToolkit.run(
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
await core.group(`Image info`, async () => {
|
await core.group(`Binfmt version`, async () => {
|
||||||
await Docker.getExecOutput(['image', 'inspect', input.image], {
|
await Docker.getExecOutput(['run', '--rm', '--privileged', input.image, '--version'], {
|
||||||
ignoreReturnCode: true
|
ignoreReturnCode: true
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.stderr.length > 0 && res.exitCode != 0) {
|
if (res.stderr.length > 0 && res.exitCode != 0) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue