mirror of
https://github.com/docker/setup-docker-action.git
synced 2025-06-15 07:47:15 +02:00
Compare commits
11 Commits
Author | SHA1 | Date | |
---|---|---|---|
ce60bfdfe1 | |||
24d5692d29 | |||
c322702919 | |||
ba6df22a99 | |||
751eb0de7b | |||
2c7b4c9ba9 | |||
0e98cdfc95 | |||
e5467b74ef | |||
d298db0f7d | |||
74272b7110 | |||
d3292ed6bc |
41
.github/workflows/ci.yml
vendored
41
.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:
|
||||||
@ -102,6 +131,18 @@ jobs:
|
|||||||
if: always()
|
if: always()
|
||||||
uses: crazy-max/ghaction-dump-context@v2
|
uses: crazy-max/ghaction-dump-context@v2
|
||||||
|
|
||||||
|
colima-start-args:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
-
|
||||||
|
name: Set up Docker
|
||||||
|
uses: ./
|
||||||
|
env:
|
||||||
|
COLIMA_START_ARGS: --cpu 4 --memory 8 --disk 32 --dns 1.1.1.1 --dns 8.8.8.8 --dns-host example.com=1.2.3.4
|
||||||
|
|
||||||
build-linux:
|
build-linux:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
|
60
README.md
60
README.md
@ -14,6 +14,9 @@ Works on Linux, macOS and Windows.
|
|||||||
___
|
___
|
||||||
|
|
||||||
* [Usage](#usage)
|
* [Usage](#usage)
|
||||||
|
* [Quick start](#quick-start)
|
||||||
|
* [Daemon configuration](#daemon-configuration)
|
||||||
|
* [Define custom `colima start` arguments (macOS)](#define-custom-colima-start-arguments-macos)
|
||||||
* [Customizing](#customizing)
|
* [Customizing](#customizing)
|
||||||
* [inputs](#inputs)
|
* [inputs](#inputs)
|
||||||
* [Notes](#notes)
|
* [Notes](#notes)
|
||||||
@ -22,6 +25,8 @@ ___
|
|||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
### Quick start
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
name: ci
|
name: ci
|
||||||
|
|
||||||
@ -37,6 +42,58 @@ 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Define custom `colima start` arguments (macOS)
|
||||||
|
|
||||||
|
You can define custom [`colima start` arguments](https://github.com/abiosoft/colima#customizing-the-vm)
|
||||||
|
using the `COLIMA_START_ARGS` environment variable to customize the VM:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
name: ci
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
docker:
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
-
|
||||||
|
name: Set up Docker
|
||||||
|
uses: crazy-max/ghaction-setup-docker@v1
|
||||||
|
env:
|
||||||
|
COLIMA_START_ARGS: --cpu 4 --memory 8 --disk 32
|
||||||
|
```
|
||||||
|
|
||||||
## Customizing
|
## Customizing
|
||||||
|
|
||||||
### inputs
|
### inputs
|
||||||
@ -44,9 +101,10 @@ jobs:
|
|||||||
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`). |
|
||||||
|
| `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. |
|
||||||
|
|
||||||
## 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
|
||||||
|
6
dist/index.js
generated
vendored
6
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
25
dist/licenses.txt
generated
vendored
25
dist/licenses.txt
generated
vendored
@ -965,6 +965,31 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
|
||||||
|
js-yaml
|
||||||
|
MIT
|
||||||
|
(The MIT License)
|
||||||
|
|
||||||
|
Copyright (C) 2011-2015 by Vitaly Puzrin
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
|
||||||
jwt-decode
|
jwt-decode
|
||||||
MIT
|
MIT
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.10.0",
|
"@actions/core": "^1.10.0",
|
||||||
"@docker/actions-toolkit": "^0.10.0",
|
"@docker/actions-toolkit": "^0.12.0-rc.1",
|
||||||
"uuid": "^9.0.0"
|
"uuid": "^9.0.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
@ -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) {
|
||||||
|
19
yarn.lock
19
yarn.lock
@ -480,10 +480,10 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
"@cspotcode/source-map-consumer" "0.8.0"
|
"@cspotcode/source-map-consumer" "0.8.0"
|
||||||
|
|
||||||
"@docker/actions-toolkit@^0.10.0":
|
"@docker/actions-toolkit@^0.12.0-rc.1":
|
||||||
version "0.10.0"
|
version "0.12.0-rc.1"
|
||||||
resolved "https://registry.yarnpkg.com/@docker/actions-toolkit/-/actions-toolkit-0.10.0.tgz#5a2769ae48c93c689db2b9c665cd9fb80123c419"
|
resolved "https://registry.yarnpkg.com/@docker/actions-toolkit/-/actions-toolkit-0.12.0-rc.1.tgz#a6a163770c776db4c32106e497d752b91378cff1"
|
||||||
integrity sha512-87ivF6QROwDTeWCfIEK+JLkp5H0f/HGuDF4/VlulvZQFARiv344Xi5MBFTAU4Zd3kxKYEE2RwTw01aYDLr08Nw==
|
integrity sha512-/p/zoVOh6UePqtRu49c/bI5oxOfs2GvPL9s8DL5y02swkx6kETEpwyMRbYTalDVlvsTcDJwPF8UbLZRheuaxFA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@actions/cache" "^3.2.2"
|
"@actions/cache" "^3.2.2"
|
||||||
"@actions/core" "^1.10.0"
|
"@actions/core" "^1.10.0"
|
||||||
@ -494,8 +494,9 @@
|
|||||||
"@actions/tool-cache" "^2.0.1"
|
"@actions/tool-cache" "^2.0.1"
|
||||||
"@octokit/plugin-rest-endpoint-methods" "^7.2.3"
|
"@octokit/plugin-rest-endpoint-methods" "^7.2.3"
|
||||||
async-retry "^1.3.3"
|
async-retry "^1.3.3"
|
||||||
csv-parse "^5.4.0"
|
csv-parse "^5.5.0"
|
||||||
handlebars "^4.7.8"
|
handlebars "^4.7.8"
|
||||||
|
js-yaml "^4.1.0"
|
||||||
jwt-decode "^3.1.2"
|
jwt-decode "^3.1.2"
|
||||||
semver "^7.5.4"
|
semver "^7.5.4"
|
||||||
tmp "^0.2.1"
|
tmp "^0.2.1"
|
||||||
@ -1576,10 +1577,10 @@ cssstyle@^2.3.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
cssom "~0.3.6"
|
cssom "~0.3.6"
|
||||||
|
|
||||||
csv-parse@^5.4.0:
|
csv-parse@^5.5.0:
|
||||||
version "5.4.0"
|
version "5.5.0"
|
||||||
resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-5.4.0.tgz#6793210a4a49a9a74b3fde3f9d00f3f52044fd89"
|
resolved "https://registry.yarnpkg.com/csv-parse/-/csv-parse-5.5.0.tgz#2313421e69b650dae32a79ac884b20b21ca1d9da"
|
||||||
integrity sha512-JiQosUWiOFgp4hQn0an+SBoV9IKdqzhROM0iiN4LB7UpfJBlsSJlWl9nq4zGgxgMAzHJ6V4t29VAVD+3+2NJAg==
|
integrity sha512-RxruSK3M4XgzcD7Trm2wEN+SJ26ChIb903+IWxNOcB5q4jT2Cs+hFr6QP39J05EohshRFEvyzEBoZ/466S2sbw==
|
||||||
|
|
||||||
data-urls@^2.0.0:
|
data-urls@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
|
Reference in New Issue
Block a user