Remove container
This commit is contained in:
@@ -73,3 +73,17 @@ export async function stopContainer(containerId: string) {
|
||||
).data
|
||||
);
|
||||
}
|
||||
|
||||
export async function removeContainer(containerId: string) {
|
||||
const nodes = await getNodes();
|
||||
|
||||
nodes.forEach(
|
||||
async (n) =>
|
||||
await (
|
||||
await axios.delete(`http://${n.ip}:3000/api/container`, {
|
||||
headers: { Authorization: `ApiKey ${n.key}` },
|
||||
params: { containerId },
|
||||
})
|
||||
).data
|
||||
);
|
||||
}
|
||||
|
||||
@@ -23,3 +23,7 @@ export async function startContainer(containerId: string) {
|
||||
export async function stopContainer(containerId: string) {
|
||||
await docker.getContainer(containerId).stop();
|
||||
}
|
||||
|
||||
export async function removeContainer(containerId: string) {
|
||||
await docker.getContainer(containerId).remove();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user