Skip to content

Commit 2afeeaa

Browse files
committed
copy dockerd-rootless.sh
Signed-off-by: Paweł Gronowski <[email protected]>
1 parent 62e55fb commit 2afeeaa

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/docker/install.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export class Install {
9393
return this._toolDir || Context.tmpDir();
9494
}
9595

96-
async downloadStaticArchive(component: 'docker' | 'docker-rootless-extras', src: InstallSourceArchive, extractFolder?: string): Promise<string> {
96+
async downloadStaticArchive(component: 'docker' | 'docker-rootless-extras', src: InstallSourceArchive): Promise<string> {
9797
const release: GitHubRelease = await Install.getRelease(src.version);
9898
this._version = release.tag_name.replace(/^v+|v+$/g, '');
9999
core.debug(`docker.Install.download version: ${this._version}`);
@@ -104,15 +104,16 @@ export class Install {
104104
const downloadPath = await tc.downloadTool(downloadURL);
105105
core.debug(`docker.Install.download downloadPath: ${downloadPath}`);
106106

107+
let extractFolder;
107108
if (os.platform() == 'win32') {
108109
extractFolder = await tc.extractZip(downloadPath, extractFolder);
109110
} else {
110111
extractFolder = await tc.extractTar(downloadPath, extractFolder);
111112
}
112-
if (Util.isDirectory(path.join(extractFolder, 'docker'))) {
113-
extractFolder = path.join(extractFolder, 'docker');
113+
if (Util.isDirectory(path.join(extractFolder, component))) {
114+
extractFolder = path.join(extractFolder, component);
114115
}
115-
core.info(`docker.Install.download extractFolder: ${extractFolder}`);
116+
core.debug(`docker.Install.download extractFolder: ${extractFolder}`);
116117
return extractFolder;
117118
}
118119

@@ -168,7 +169,8 @@ export class Install {
168169
extractFolder = await this.downloadStaticArchive('docker', this.source);
169170
if (this.rootless) {
170171
core.info(`Downloading Docker rootless extras ${version} from ${this.source.channel} at download.docker.com`);
171-
extractFolder = await this.downloadStaticArchive('docker-rootless-extras', this.source, extractFolder);
172+
const extrasFolder = await this.downloadStaticArchive('docker-rootless-extras', this.source);
173+
fs.copyFileSync(path.join(extrasFolder, 'dockerd-rootless.sh'), path.join(extractFolder, 'dockerd-rootless.sh'));
172174
}
173175
break;
174176
}

0 commit comments

Comments
 (0)