microshed-testing icon indicating copy to clipboard operation
microshed-testing copied to clipboard

Remove left over docker images

Open KyleAure opened this issue 5 years ago • 2 comments

As a user of the system-test package, I would like to use the integration test capabilities of this package for test driven development. However, after performing an integration test, there is an un-tagged docker image left over (in this case liberty). These images should be cleaned up after tests are done.

kyleaure $  docker images
REPOSITORY                        TAG                 IMAGE ID            CREATED             SIZE
<none>                            <none>              4f9beb902785        27 seconds ago      454MB
<none>                            <none>              92665d6533e9        About an hour ago   454MB
<none>                            <none>              4bb455866900        About an hour ago   454MB
<none>                            <none>              0a836e010c64        About an hour ago   454MB
<none>                            <none>              610d278151d9        About an hour ago   454MB

KyleAure avatar Aug 14 '19 18:08 KyleAure

I assume you are using the default new MicroProfileApplication() constructor here? If so, this should resolve using new ImageFromDockerfile(String dockerImage), which does delegate to ImageFromDockerfile(String dockerImageName, boolean deleteOnExit) with deleteOnExit=true.

The images should be getting cleaned up automatically by Testcontainers with the JVM shutdown hook they register, but I can see locally that's not happening for some reason.

aguibert avatar Aug 14 '19 20:08 aguibert

Should be fixed by https://github.com/testcontainers/testcontainers-java/pull/1745

aguibert avatar Aug 14 '19 23:08 aguibert

@KyleAure is this one still relevant?

appiepollo14 avatar Nov 07 '23 15:11 appiepollo14