mirror of
https://github.com/docker/setup-docker-action.git
synced 2025-04-21 00:00:02 +02:00
daemon-config input
This commit is contained in:
parent
d298db0f7d
commit
e5467b74ef
29
.github/workflows/ci.yml
vendored
29
.github/workflows/ci.yml
vendored
@ -74,6 +74,35 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
uses: crazy-max/ghaction-dump-context@v2
|
uses: crazy-max/ghaction-dump-context@v2
|
||||||
|
|
||||||
|
daemon-config:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os:
|
||||||
|
- ubuntu-latest
|
||||||
|
- macos-latest
|
||||||
|
- windows-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
name: Set up Docker
|
||||||
|
uses: ./
|
||||||
|
with:
|
||||||
|
daemon-config: |
|
||||||
|
{
|
||||||
|
"debug": true,
|
||||||
|
"features": {
|
||||||
|
"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 }}
|
||||||
strategy:
|
strategy:
|
||||||
|
45
README.md
45
README.md
@ -14,6 +14,8 @@ Works on Linux, macOS and Windows.
|
|||||||
___
|
___
|
||||||
|
|
||||||
* [Usage](#usage)
|
* [Usage](#usage)
|
||||||
|
* [Quick start](#quick-start)
|
||||||
|
* [Daemon configuration](#daemon-configuration)
|
||||||
* [Customizing](#customizing)
|
* [Customizing](#customizing)
|
||||||
* [inputs](#inputs)
|
* [inputs](#inputs)
|
||||||
* [Notes](#notes)
|
* [Notes](#notes)
|
||||||
@ -22,6 +24,8 @@ ___
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
### Quick start
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: ci
|
name: ci
|
||||||
|
|
||||||
@ -37,17 +41,48 @@ jobs:
|
|||||||
uses: crazy-max/ghaction-setup-docker@v1
|
uses: crazy-max/ghaction-setup-docker@v1
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Daemon configuration
|
||||||
|
|
||||||
|
You can [configure the Docker daemon](https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file)
|
||||||
|
using the `daemon-config` input. In the following example, we configure the
|
||||||
|
Docker daemon to enable debug and the [containerd image store](https://docs.docker.com/storage/containerd/)
|
||||||
|
feature:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Set up Docker
|
||||||
|
uses: crazy-max/ghaction-setup-docker@v1
|
||||||
|
with:
|
||||||
|
daemon-config: |
|
||||||
|
{
|
||||||
|
"debug": true,
|
||||||
|
"features": {
|
||||||
|
"containerd-snapshotter": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## Customizing
|
## Customizing
|
||||||
|
|
||||||
### inputs
|
### inputs
|
||||||
|
|
||||||
Following inputs can be used as `step.with` keys
|
Following inputs can be used as `step.with` keys
|
||||||
|
|
||||||
| Name | Type | Default | Description |
|
| Name | Type | Default | Description |
|
||||||
|-----------|--------|-----------------------|---------------------------------------------------------------------------------------------------|
|
|-----------------|--------|-----------------------|-----------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `version` | String | `latest` | Docker CE version (e.g., `v23.0.1`). |
|
| `version` | String | `latest` | Docker CE version (e.g., `v23.0.1`). |
|
||||||
| `channel` | String | `stable` | Docker CE [channel](https://download.docker.com/linux/static/) (e.g, `stable`, `edge` or `test`). |
|
| `channel` | String | `stable` | Docker CE [channel](https://download.docker.com/linux/static/) (e.g, `stable`, `edge` or `test`). |
|
||||||
| `context` | String | `setup-docker-action` | Docker context name. |
|
| `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. |
|
||||||
|
|
||||||
## Notes
|
## Notes
|
||||||
|
|
||||||
|
@ -23,6 +23,7 @@ describe('getInputs', () => {
|
|||||||
version: 'v23.0.1',
|
version: 'v23.0.1',
|
||||||
channel: '',
|
channel: '',
|
||||||
context: '',
|
context: '',
|
||||||
|
daemonConfig: '',
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -31,11 +32,13 @@ describe('getInputs', () => {
|
|||||||
['version', 'v23.0.0-rc.4'],
|
['version', 'v23.0.0-rc.4'],
|
||||||
['channel', 'test'],
|
['channel', 'test'],
|
||||||
['context', 'foo'],
|
['context', 'foo'],
|
||||||
|
['daemon-config', `{"debug":true,"features":{"containerd-snapshotter":true}}`],
|
||||||
]),
|
]),
|
||||||
{
|
{
|
||||||
version: 'v23.0.0-rc.4',
|
version: 'v23.0.0-rc.4',
|
||||||
channel: 'test',
|
channel: 'test',
|
||||||
context: 'foo',
|
context: 'foo',
|
||||||
|
daemonConfig: `{"debug":true,"features":{"containerd-snapshotter":true}}`,
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
@ -45,6 +48,7 @@ describe('getInputs', () => {
|
|||||||
version: 'latest',
|
version: 'latest',
|
||||||
channel: '',
|
channel: '',
|
||||||
context: '',
|
context: '',
|
||||||
|
daemonConfig: '',
|
||||||
} as context.Inputs
|
} as context.Inputs
|
||||||
]
|
]
|
||||||
])(
|
])(
|
||||||
|
@ -14,6 +14,9 @@ inputs:
|
|||||||
channel:
|
channel:
|
||||||
description: 'Docker CE channel. (e.g, stable, edge or test)'
|
description: 'Docker CE channel. (e.g, stable, edge or test)'
|
||||||
required: false
|
required: false
|
||||||
|
daemon-config:
|
||||||
|
description: 'Docker daemon JSON configuration'
|
||||||
|
required: false
|
||||||
context:
|
context:
|
||||||
description: 'Docker context name. (default setup-docker-action)'
|
description: 'Docker context name. (default setup-docker-action)'
|
||||||
required: false
|
required: false
|
||||||
|
@ -3,6 +3,7 @@ import * as core from '@actions/core';
|
|||||||
export interface Inputs {
|
export interface Inputs {
|
||||||
version: string;
|
version: string;
|
||||||
channel: string;
|
channel: string;
|
||||||
|
daemonConfig?: string;
|
||||||
context: string;
|
context: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -10,6 +11,7 @@ export function getInputs(): Inputs {
|
|||||||
return {
|
return {
|
||||||
version: core.getInput('version') || 'latest',
|
version: core.getInput('version') || 'latest',
|
||||||
channel: core.getInput('channel'),
|
channel: core.getInput('channel'),
|
||||||
|
daemonConfig: core.getInput('daemon-config'),
|
||||||
context: core.getInput('context')
|
context: core.getInput('context')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,8 @@ actionsToolkit.run(
|
|||||||
runDir: runDir,
|
runDir: runDir,
|
||||||
version: input.version,
|
version: input.version,
|
||||||
channel: input.channel || 'stable',
|
channel: input.channel || 'stable',
|
||||||
contextName: input.context || 'setup-docker-action'
|
contextName: input.context || 'setup-docker-action',
|
||||||
|
daemonConfig: input.daemonConfig
|
||||||
});
|
});
|
||||||
let toolDir;
|
let toolDir;
|
||||||
if (!(await Docker.isAvailable()) || input.version) {
|
if (!(await Docker.isAvailable()) || input.version) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user