microshed-testing
microshed-testing copied to clipboard
Remove left over docker images
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
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.
Should be fixed by https://github.com/testcontainers/testcontainers-java/pull/1745
@KyleAure is this one still relevant?