mirror of
https://github.com/renovatebot/github-action.git
synced 2025-12-16 17:02:36 +00:00
feat: add docker-socket-host-path input (#862)
Co-authored-by: Michael Kriese <michael.kriese@visualon.de>
This commit is contained in:
parent
669f02b0b3
commit
c0afe86658
4 changed files with 27 additions and 1 deletions
|
|
@ -73,6 +73,10 @@ class Input {
|
|||
return core.getInput('mount-docker-socket') === 'true';
|
||||
}
|
||||
|
||||
dockerSocketHostPath(): string {
|
||||
return core.getInput('docker-socket-host-path') || '/var/run/docker.sock';
|
||||
}
|
||||
|
||||
getDockerCmdFile(): string | null {
|
||||
const cmdFile = core.getInput('docker-cmd-file');
|
||||
return !!cmdFile && cmdFile !== '' ? path.resolve(cmdFile) : null;
|
||||
|
|
|
|||
|
|
@ -33,8 +33,16 @@ class Renovate {
|
|||
}
|
||||
|
||||
if (this.input.mountDockerSocket()) {
|
||||
const sockPath = this.input.dockerSocketHostPath();
|
||||
const stat = await fs.stat(sockPath);
|
||||
if (!stat.isSocket()) {
|
||||
throw new Error(
|
||||
`docker socket host path '${sockPath}' MUST exist and be a socket`,
|
||||
);
|
||||
}
|
||||
|
||||
dockerArguments.push(
|
||||
'--volume /var/run/docker.sock:/var/run/docker.sock',
|
||||
`--volume ${sockPath}:/var/run/docker.sock`,
|
||||
`--group-add ${await this.getDockerGroupId()}`,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue