mirror of
https://github.moeyy.xyz/https://github.com/docker/setup-docker-action.git
synced 2025-10-27 16:16:47 +08:00
add runtime-basedir input
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
29412e2cf6
commit
de8d0f39ec
@ -122,7 +122,7 @@ The following inputs can be used as `step.with` keys
|
||||
| `context` | String | `setup-docker-action` | Docker context name. |
|
||||
| `set-host` | Bool | `false` | Set `DOCKER_HOST` environment variable to docker socket path. |
|
||||
| `rootless` | Bool | `false` | Start daemon in rootless mode |
|
||||
|
||||
| `runtime-basedir` | String | `<home>/setup-docker-action` | Docker runtime base directory
|
||||
### inputs.version
|
||||
|
||||
By default, the latest stable version of Docker is fetched from download.docker.com.
|
||||
|
||||
@ -31,6 +31,9 @@ inputs:
|
||||
description: 'Enable Docker rootless mode'
|
||||
default: 'false'
|
||||
required: false
|
||||
runtime-basedir:
|
||||
description: 'Docker runtime base directory'
|
||||
required: false
|
||||
|
||||
outputs:
|
||||
sock:
|
||||
|
||||
@ -11,6 +11,7 @@ export interface Inputs {
|
||||
context: string;
|
||||
setHost: boolean;
|
||||
rootless: boolean;
|
||||
runtimeBasedir?: string;
|
||||
}
|
||||
|
||||
export function getInputs(): Inputs {
|
||||
@ -27,7 +28,8 @@ export function getInputs(): Inputs {
|
||||
tcpPort: Util.getInputNumber('tcp-port'),
|
||||
context: core.getInput('context'),
|
||||
setHost: core.getBooleanInput('set-host'),
|
||||
rootless: core.getBooleanInput('rootless')
|
||||
rootless: core.getBooleanInput('rootless'),
|
||||
runtimeBasedir: core.getInput('runtime-basedir')
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -18,7 +18,8 @@ actionsToolkit.run(
|
||||
// main
|
||||
async () => {
|
||||
const input: context.Inputs = context.getInputs();
|
||||
const runDir = path.join(os.homedir(), `setup-docker-action-${crypto.randomUUID().slice(0, 8)}`);
|
||||
const runBasedir = input.runtimeBasedir || path.join(os.homedir(), `setup-docker-action`);
|
||||
const runDir = path.join(runBasedir, `run-${crypto.randomUUID().slice(0, 8)}`);
|
||||
|
||||
if (input.context == 'default') {
|
||||
throw new Error(`'default' context cannot be used.`);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user