mirror of
https://github.com/docker/setup-docker-action.git
synced 2025-04-20 07:40:02 +02:00
commit
332d315257
46
.github/workflows/ci.yml
vendored
46
.github/workflows/ci.yml
vendored
@ -55,10 +55,6 @@ jobs:
|
|||||||
uses: ./
|
uses: ./
|
||||||
with:
|
with:
|
||||||
version: ${{ env.DOCKER_VERSION }}
|
version: ${{ env.DOCKER_VERSION }}
|
||||||
-
|
|
||||||
name: Dump context
|
|
||||||
if: always()
|
|
||||||
uses: crazy-max/ghaction-dump-context@v2
|
|
||||||
|
|
||||||
channel:
|
channel:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@ -85,10 +81,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: v24.0.0-rc.4
|
version: v24.0.0-rc.4
|
||||||
channel: test
|
channel: test
|
||||||
-
|
|
||||||
name: Dump context
|
|
||||||
if: always()
|
|
||||||
uses: crazy-max/ghaction-dump-context@v2
|
|
||||||
|
|
||||||
daemon-config:
|
daemon-config:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@ -120,10 +112,6 @@ jobs:
|
|||||||
"containerd-snapshotter": true
|
"containerd-snapshotter": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
-
|
|
||||||
name: Dump context
|
|
||||||
if: always()
|
|
||||||
uses: crazy-max/ghaction-dump-context@v2
|
|
||||||
|
|
||||||
context:
|
context:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@ -154,10 +142,6 @@ jobs:
|
|||||||
name: Check context
|
name: Check context
|
||||||
run: |
|
run: |
|
||||||
docker context inspect foo
|
docker context inspect foo
|
||||||
-
|
|
||||||
name: Dump context
|
|
||||||
if: always()
|
|
||||||
uses: crazy-max/ghaction-dump-context@v2
|
|
||||||
|
|
||||||
lima-start-args:
|
lima-start-args:
|
||||||
#runs-on: macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
|
#runs-on: macos-14 # no virt: https://github.com/docker/actions-toolkit/issues/317
|
||||||
@ -220,10 +204,6 @@ jobs:
|
|||||||
name: Inspect
|
name: Inspect
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
|
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
|
||||||
-
|
|
||||||
name: Dump context
|
|
||||||
if: always()
|
|
||||||
uses: crazy-max/ghaction-dump-context@v2
|
|
||||||
|
|
||||||
build-macos:
|
build-macos:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
@ -270,10 +250,6 @@ jobs:
|
|||||||
name: Inspect
|
name: Inspect
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
|
docker buildx imagetools inspect localhost:5000/name/app:latest --format '{{json .}}'
|
||||||
-
|
|
||||||
name: Dump context
|
|
||||||
if: always()
|
|
||||||
uses: crazy-max/ghaction-dump-context@v2
|
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-latest
|
runs-on: windows-latest
|
||||||
@ -295,10 +271,6 @@ jobs:
|
|||||||
name: Inspect
|
name: Inspect
|
||||||
run: |
|
run: |
|
||||||
docker image inspect test
|
docker image inspect test
|
||||||
-
|
|
||||||
name: Dump context
|
|
||||||
if: always()
|
|
||||||
uses: crazy-max/ghaction-dump-context@v2
|
|
||||||
|
|
||||||
set-host:
|
set-host:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -315,7 +287,19 @@ jobs:
|
|||||||
name: List contexts
|
name: List contexts
|
||||||
run: |
|
run: |
|
||||||
docker context ls
|
docker context ls
|
||||||
|
|
||||||
|
rootless:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
-
|
-
|
||||||
name: Dump context
|
name: Checkout
|
||||||
if: always()
|
uses: actions/checkout@v4
|
||||||
uses: crazy-max/ghaction-dump-context@v2
|
-
|
||||||
|
name: Set up Docker
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
rootless: true
|
||||||
|
-
|
||||||
|
name: List contexts
|
||||||
|
run: |
|
||||||
|
docker context ls
|
||||||
|
@ -135,6 +135,7 @@ The following inputs can be used as `step.with` keys
|
|||||||
| `daemon-config` | String | | [Docker daemon JSON configuration](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file) |
|
| `daemon-config` | String | | [Docker daemon JSON configuration](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file) |
|
||||||
| `context` | String | `setup-docker-action` | Docker context name. |
|
| `context` | String | `setup-docker-action` | Docker context name. |
|
||||||
| `set-host` | Bool | `false` | Set `DOCKER_HOST` environment variable to docker socket path. |
|
| `set-host` | Bool | `false` | Set `DOCKER_HOST` environment variable to docker socket path. |
|
||||||
|
| `rootless` | Bool | `false` | Start daemon in rootless mode |
|
||||||
|
|
||||||
### outputs
|
### outputs
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ describe('getInputs', () => {
|
|||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['version', 'v24.0.8'],
|
['version', 'v24.0.8'],
|
||||||
['set-host', 'false'],
|
['set-host', 'false'],
|
||||||
|
['rootless', 'false'],
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
@ -28,6 +29,7 @@ describe('getInputs', () => {
|
|||||||
},
|
},
|
||||||
context: '',
|
context: '',
|
||||||
daemonConfig: '',
|
daemonConfig: '',
|
||||||
|
rootless: false,
|
||||||
setHost: false
|
setHost: false
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
@ -39,6 +41,7 @@ describe('getInputs', () => {
|
|||||||
['context', 'foo'],
|
['context', 'foo'],
|
||||||
['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`],
|
['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`],
|
||||||
['set-host', 'false'],
|
['set-host', 'false'],
|
||||||
|
['rootless', 'false'],
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
@ -48,6 +51,7 @@ describe('getInputs', () => {
|
|||||||
},
|
},
|
||||||
context: 'foo',
|
context: 'foo',
|
||||||
daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`,
|
daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`,
|
||||||
|
rootless: false,
|
||||||
setHost: false
|
setHost: false
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
@ -55,6 +59,7 @@ describe('getInputs', () => {
|
|||||||
2,
|
2,
|
||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['set-host', 'true'],
|
['set-host', 'true'],
|
||||||
|
['rootless', 'false'],
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
@ -64,6 +69,7 @@ describe('getInputs', () => {
|
|||||||
},
|
},
|
||||||
context: '',
|
context: '',
|
||||||
daemonConfig: '',
|
daemonConfig: '',
|
||||||
|
rootless: false,
|
||||||
setHost: true
|
setHost: true
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
@ -74,6 +80,7 @@ describe('getInputs', () => {
|
|||||||
['context', 'foo'],
|
['context', 'foo'],
|
||||||
['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`],
|
['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`],
|
||||||
['set-host', 'false'],
|
['set-host', 'false'],
|
||||||
|
['rootless', 'false'],
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
@ -82,6 +89,7 @@ describe('getInputs', () => {
|
|||||||
},
|
},
|
||||||
context: 'foo',
|
context: 'foo',
|
||||||
daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`,
|
daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`,
|
||||||
|
rootless: false,
|
||||||
setHost: false
|
setHost: false
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
@ -90,6 +98,7 @@ describe('getInputs', () => {
|
|||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['version', 'type=image'],
|
['version', 'type=image'],
|
||||||
['set-host', 'false'],
|
['set-host', 'false'],
|
||||||
|
['rootless', 'false'],
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
@ -98,6 +107,7 @@ describe('getInputs', () => {
|
|||||||
},
|
},
|
||||||
context: '',
|
context: '',
|
||||||
daemonConfig: '',
|
daemonConfig: '',
|
||||||
|
rootless: false,
|
||||||
setHost: false
|
setHost: false
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
@ -106,6 +116,7 @@ describe('getInputs', () => {
|
|||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['version', 'type=archive'],
|
['version', 'type=archive'],
|
||||||
['set-host', 'false'],
|
['set-host', 'false'],
|
||||||
|
['rootless', 'false'],
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
@ -116,6 +127,7 @@ describe('getInputs', () => {
|
|||||||
setHost: false,
|
setHost: false,
|
||||||
context: '',
|
context: '',
|
||||||
daemonConfig: '',
|
daemonConfig: '',
|
||||||
|
rootless: false,
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -123,6 +135,7 @@ describe('getInputs', () => {
|
|||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['version', 'version=v27.2.0,channel=test'],
|
['version', 'version=v27.2.0,channel=test'],
|
||||||
['set-host', 'false'],
|
['set-host', 'false'],
|
||||||
|
['rootless', 'false'],
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
@ -133,6 +146,7 @@ describe('getInputs', () => {
|
|||||||
setHost: false,
|
setHost: false,
|
||||||
context: '',
|
context: '',
|
||||||
daemonConfig: '',
|
daemonConfig: '',
|
||||||
|
rootless: false,
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -140,6 +154,7 @@ describe('getInputs', () => {
|
|||||||
new Map<string, string>([
|
new Map<string, string>([
|
||||||
['version', 'type=image,tag=27.2.1'],
|
['version', 'type=image,tag=27.2.1'],
|
||||||
['set-host', 'false'],
|
['set-host', 'false'],
|
||||||
|
['rootless', 'false'],
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
source: {
|
source: {
|
||||||
@ -149,6 +164,25 @@ describe('getInputs', () => {
|
|||||||
setHost: false,
|
setHost: false,
|
||||||
context: '',
|
context: '',
|
||||||
daemonConfig: '',
|
daemonConfig: '',
|
||||||
|
rootless: false,
|
||||||
|
} as context.Inputs
|
||||||
|
],
|
||||||
|
[
|
||||||
|
8,
|
||||||
|
new Map<string, string>([
|
||||||
|
['version', 'type=image,tag=27.2.1'],
|
||||||
|
['set-host', 'false'],
|
||||||
|
['rootless', 'true']
|
||||||
|
]),
|
||||||
|
{
|
||||||
|
source: {
|
||||||
|
type: 'image',
|
||||||
|
tag: '27.2.1',
|
||||||
|
},
|
||||||
|
setHost: false,
|
||||||
|
context: '',
|
||||||
|
daemonConfig: '',
|
||||||
|
rootless: true,
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
])(
|
])(
|
||||||
|
@ -24,6 +24,10 @@ inputs:
|
|||||||
description: 'Set DOCKER_HOST environment variable to docker socket path'
|
description: 'Set DOCKER_HOST environment variable to docker socket path'
|
||||||
default: 'false'
|
default: 'false'
|
||||||
required: false
|
required: false
|
||||||
|
rootless:
|
||||||
|
description: 'Enable Docker rootless mode'
|
||||||
|
default: 'false'
|
||||||
|
required: false
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
sock:
|
sock:
|
||||||
|
2
dist/index.js
generated
vendored
2
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
@ -7,6 +7,7 @@ export interface Inputs {
|
|||||||
daemonConfig?: string;
|
daemonConfig?: string;
|
||||||
context: string;
|
context: string;
|
||||||
setHost: boolean;
|
setHost: boolean;
|
||||||
|
rootless: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getInputs(): Inputs {
|
export function getInputs(): Inputs {
|
||||||
@ -21,7 +22,8 @@ export function getInputs(): Inputs {
|
|||||||
source: source,
|
source: source,
|
||||||
daemonConfig: core.getInput('daemon-config'),
|
daemonConfig: core.getInput('daemon-config'),
|
||||||
context: core.getInput('context'),
|
context: core.getInput('context'),
|
||||||
setHost: core.getBooleanInput('set-host')
|
setHost: core.getBooleanInput('set-host'),
|
||||||
|
rootless: core.getBooleanInput('rootless')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ actionsToolkit.run(
|
|||||||
const install = new Install({
|
const install = new Install({
|
||||||
runDir: runDir,
|
runDir: runDir,
|
||||||
source: input.source,
|
source: input.source,
|
||||||
|
rootless: input.rootless,
|
||||||
contextName: input.context || 'setup-docker-action',
|
contextName: input.context || 'setup-docker-action',
|
||||||
daemonConfig: input.daemonConfig
|
daemonConfig: input.daemonConfig
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user