jenkinsci / jenkinsci/docker-workflow-plugin
[JENKINS-67443] docker is failed to stop & rm container that was already stopped and exit with error
- Dominant language
- Java
- Stars
- 527
- Forks
- 422
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Description
When I'm using the inside method to run my unit test inside my docker and when the test is failed the container will be exit with error and will be removed, but the docker plugin will try to stop & rm container which is not exist any more.

Reproduction steps
docker.image(img_name).inside(-u root:root --entrypoint=){
sh "exit 1"
}
Results
Expected result:
The docker stop and rm should exit with 0 by checking if container exist, if yes kill it, if not skip
Actual result:
docker stop and rm exit with exit error 1
---
Originally reported by dordor, imported from: docker is failed to stop & rm container that was already stopped and exit with error
Raw content of original issue
When I'm using the inside method to run my unit test inside my docker and when the test is failed the container will be exit with error and will be removed, but the docker plugin will try to stop & rm container which is not exist any more.
Reproduction steps
docker.image(img_name).inside(-u root:root --entrypoint=){
sh "exit 1"
}
Results
Expected result:
The docker stop and rm should exit with 0 by checking if container exist, if yes kill it, if not skip
Actual result:
docker stop and rm exit with exit error 1
Contributor guide
Assessment
This issue has not been assessed yet.