mirror of
https://github.com/docker/setup-docker-action.git
synced 2026-04-06 12:49:26 +00:00
tcp-port opt to expose Docker API to a local TCP address
This commit is contained in:
parent
fde3095c59
commit
3a56725668
6 changed files with 77 additions and 5 deletions
14
src/main.ts
14
src/main.ts
|
|
@ -19,12 +19,20 @@ actionsToolkit.run(
|
|||
throw new Error(`'default' context cannot be used.`);
|
||||
}
|
||||
|
||||
let tcpPort: number | undefined;
|
||||
let tcpAddress: string | undefined;
|
||||
if (input.tcpPort) {
|
||||
tcpPort = input.tcpPort;
|
||||
tcpAddress = `tcp://127.0.0.1:${tcpPort}`;
|
||||
}
|
||||
|
||||
const install = new Install({
|
||||
runDir: runDir,
|
||||
source: input.source,
|
||||
rootless: input.rootless,
|
||||
contextName: input.context || 'setup-docker-action',
|
||||
daemonConfig: input.daemonConfig
|
||||
daemonConfig: input.daemonConfig,
|
||||
localTCPPort: tcpPort
|
||||
});
|
||||
let toolDir;
|
||||
if (!(await Docker.isAvailable()) || input.source) {
|
||||
|
|
@ -38,6 +46,10 @@ actionsToolkit.run(
|
|||
await core.group(`Setting outputs`, async () => {
|
||||
core.info(`sock=${sockPath}`);
|
||||
core.setOutput('sock', sockPath);
|
||||
if (tcpAddress) {
|
||||
core.info(`tcp=${tcpAddress}`);
|
||||
core.setOutput('tcp', tcpAddress);
|
||||
}
|
||||
});
|
||||
|
||||
if (input.setHost) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue