Skip to content

Commit 06e05cd

Browse files
authored
fix: leaking docker network&volume (#1499)
1 parent 9d27f18 commit 06e05cd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/job.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1434,7 +1434,9 @@ export class Job {
14341434
await Promise.any(Object.keys(imageInspect[0].Config.ExposedPorts).map((port) => {
14351435
if (!port.endsWith("/tcp")) return;
14361436
const portNum = parseInt(port.replace("/tcp", ""));
1437-
const spawnCmd = [this.argv.containerExecutable, "run", "--rm", `--name=gcl-wait-for-it-${this.jobId}-${serviceIndex}-${portNum}`, "--network", `${this._serviceNetworkId}`, "docker.io/sumina46/wait-for-it", `${uniqueAlias}:${portNum}`, "-t", "30"];
1437+
const containerName = `gcl-wait-for-it-${this.jobId}-${serviceIndex}-${portNum}`;
1438+
const spawnCmd = [this.argv.containerExecutable, "run", "--rm", `--name=${containerName}`, "--network", `${this._serviceNetworkId}`, "docker.io/sumina46/wait-for-it", `${uniqueAlias}:${portNum}`, "-t", "30"];
1439+
this._containersToClean.push(containerName);
14381440
return Utils.spawn(spawnCmd);
14391441
}));
14401442
const endTime = process.hrtime(time);

0 commit comments

Comments
 (0)