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