File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
src/test/java/com/github/dockerjava/core/command Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 11package com .github .dockerjava .core .command ;
22
33import com .github .dockerjava .api .DockerClient ;
4+ import com .github .dockerjava .api .NotFoundException ;
45import org .slf4j .Logger ;
56import org .slf4j .LoggerFactory ;
67
@@ -56,15 +57,19 @@ public void close() throws Exception {
5657
5758 if (containerId != null ) {
5859 LOGGER .info ("removing container {}" , containerId );
59- dockerClient
60- .removeContainerCmd (containerId )
61- .withForce () // stop too
62- .exec ();
60+ try {
61+ dockerClient
62+ .removeContainerCmd (containerId )
63+ .withForce () // stop too
64+ .exec ();
65+ } catch (NotFoundException ignored ) {
66+ LOGGER .info ("ignoring {}" , ignored .getMessage ());
67+ }
6368 containerId = null ;
6469 }
6570
6671 if (repository != null ) {
67- LOGGER .info ("removing repostiory {}" , repository );
72+ LOGGER .info ("removing repository {}" , repository );
6873 dockerClient
6974 .removeImageCmd (repository )
7075 .withForce ()
You can’t perform that action at this time.
0 commit comments