MCPcopy
hub / github.com/redis/node-redis / dockerRemove

Function dockerRemove

packages/client/lib/sentinel/test-util.ts:82–95  ·  view source on GitHub ↗
(dockerId: string)

Source from the content-addressed store, hash-verified

80 }
81
82 async dockerRemove(dockerId: string): Promise<void> {
83 try {
84 await this.dockerStop(dockerId);
85 } catch (err) {
86 // its ok if stop failed, as we are just going to remove, will just be slower
87 console.log(`dockerStop failed in remove: ${err}`);
88 }
89
90 const { stderr } = await execAsync(`docker rm -f ${dockerId}`);
91 if (stderr) {
92 console.log("docker rm failed");
93 throw new Error(`docker rm error - ${stderr}`);
94 }
95 }
96
97 async dockerStop(dockerId: string): Promise<void> {
98 /* this is an optimization to get around slow docker stop times, but will fail if container is already stopped */

Callers

nothing calls this directly

Calls 1

logMethod · 0.80

Tested by

no test coverage detected