From how I understand your problem and testcontainers, the problem is setting this property on the container: .withReuse(true).
With this property set to true, containers will be reused across JVM processes, meaning that the framework will not remove them after a test run finishes.