mirror of
https://github.com/docker/build-push-action.git
synced 2024-11-06 00:35:53 -05:00
Add allow input
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
78a1e0d9a3
commit
01bd5c1fa9
6 changed files with 17 additions and 0 deletions
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
|
@ -37,6 +37,9 @@ jobs:
|
|||
name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: ./setup-buildx/ # change to docker/setup-buildx-action@master
|
||||
# with:
|
||||
# driver-opt: network=host
|
||||
# buildkitd-flags:
|
||||
-
|
||||
name: Build and push
|
||||
uses: ./
|
||||
|
@ -45,6 +48,7 @@ jobs:
|
|||
file: ./test/Dockerfile-${{ matrix.dockerfile }}
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
platforms: linux/amd64,linux/arm64,linux/386
|
||||
allow: network.host,security.insecure
|
||||
#push: true
|
||||
tags: |
|
||||
localhost:5000/name/app:latest
|
||||
|
|
|
@ -82,6 +82,7 @@ Following inputs can be used as `step.with` keys
|
|||
| `tags` | String | | Newline-delimited list of tags **required** |
|
||||
| `pull` | Bool | `false` | Always attempt to pull a newer version of the image |
|
||||
| `target` | String | | Sets the target stage to build |
|
||||
| `allow` | String | | Allow extra privileged entitlement (eg. network.host,security.insecure) |
|
||||
| `no-cache` | Bool | `false` | Do not use cache when building the image |
|
||||
| `platforms` | String | | Comma-delimited list of target platforms for build |
|
||||
| `load` | Bool | `false` | Shorthand for `--output=type=docker` |
|
||||
|
|
|
@ -33,6 +33,9 @@ inputs:
|
|||
target:
|
||||
description: "Sets the target stage to build"
|
||||
required: false
|
||||
allow:
|
||||
description: "Allow extra privileged entitlement (eg. network.host,security.insecure)"
|
||||
required: false
|
||||
no-cache:
|
||||
description: "Do not use cache when building the image"
|
||||
required: false
|
||||
|
|
4
dist/index.js
generated
vendored
4
dist/index.js
generated
vendored
|
@ -1041,6 +1041,9 @@ function run() {
|
|||
if (inputs.target) {
|
||||
buildArgs.push('--target', inputs.target);
|
||||
}
|
||||
if (inputs.allow) {
|
||||
buildArgs.push('--allow', inputs.allow);
|
||||
}
|
||||
if (inputs.noCache) {
|
||||
buildArgs.push('--no-cache');
|
||||
}
|
||||
|
@ -1127,6 +1130,7 @@ function loadInputs() {
|
|||
tags: yield getInputList('tags'),
|
||||
pull: /true/i.test(core.getInput('pull')),
|
||||
target: core.getInput('target'),
|
||||
allow: core.getInput('allow'),
|
||||
noCache: /true/i.test(core.getInput('no-cache')),
|
||||
builder: core.getInput('builder'),
|
||||
platforms: core.getInput('platforms'),
|
||||
|
|
|
@ -8,6 +8,7 @@ export interface Inputs {
|
|||
tags: string[];
|
||||
pull: boolean;
|
||||
target: string;
|
||||
allow: string;
|
||||
noCache: boolean;
|
||||
builder: string;
|
||||
platforms: string;
|
||||
|
@ -27,6 +28,7 @@ export async function loadInputs(): Promise<Inputs> {
|
|||
tags: await getInputList('tags'),
|
||||
pull: /true/i.test(core.getInput('pull')),
|
||||
target: core.getInput('target'),
|
||||
allow: core.getInput('allow'),
|
||||
noCache: /true/i.test(core.getInput('no-cache')),
|
||||
builder: core.getInput('builder'),
|
||||
platforms: core.getInput('platforms'),
|
||||
|
|
|
@ -42,6 +42,9 @@ async function run(): Promise<void> {
|
|||
if (inputs.target) {
|
||||
buildArgs.push('--target', inputs.target);
|
||||
}
|
||||
if (inputs.allow) {
|
||||
buildArgs.push('--allow', inputs.allow);
|
||||
}
|
||||
if (inputs.noCache) {
|
||||
buildArgs.push('--no-cache');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue