Docker · Arazzo Workflow
Docker Stop and Remove a Container
Version 1.0.0
Find a container by name, stop it gracefully, wait for it to exit, and remove it with its anonymous volumes.
Provider
Workflows
stop-and-remove-container
Gracefully stop a container found by name and remove it once it has exited.
Resolves the container id from a name filter, stops the container with a grace period, waits on the not-running condition so removal cannot race the shutdown, and deletes the container.
1
findContainer
ContainerList
List containers including stopped ones, filtered to the supplied name, so the flow resolves a concrete container id before acting on it.
2
stopContainer
ContainerStop
Send a graceful stop to the container. The daemon returns 204 when it stopped the container and 304 when it was already stopped, so both are acceptable outcomes for this step.
3
waitForExit
ContainerWait
Block until the container reaches the not-running condition and capture the exit code, so removal cannot race a still-shutting-down container.
4
removeContainer
ContainerDelete
Remove the stopped container, optionally taking its anonymous volumes with it so the host is not left with orphaned data.