You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a port conflict when trying to clone a container, then you'll end up with the container in the Created state. The clone will fail and try to clean it up, but it doesn't end up deleting the container:
println("Removing container $container")
if (docker.containerIsRunning(container)) {
docker.rm(container, force)
} else {
docker.rmStopped(container)
}
}
fun containerIsRunning(container: String): Boolean {
val result = executor.exec(listOf("docker", "ps", "-f", "name=$container", "--format", "\"{{.Names}}\""))
return result.isNotEmpty()
}
fun rmStopped(container:String): String {
val containerId = executor.exec(listOf("docker", "ps", "-f", "status=exited", "-f", "name=$container", "--format", "{{.ID}}")).trim()
return executor.exec(listOf("docker", "container", "rm", containerId))
}
If you’re stuck in the “CREATED” state, you are not running, but also not exited. Think we should always just be doing a forced rm, not sure why we're filtering by status=exited.
The text was updated successfully, but these errors were encountered:
If you have a port conflict when trying to clone a container, then you'll end up with the container in the Created state. The clone will fail and try to clean it up, but it doesn't end up deleting the container:
If you’re stuck in the “CREATED” state, you are not running, but also not exited. Think we should always just be doing a forced rm, not sure why we're filtering by status=exited.
The text was updated successfully, but these errors were encountered: