My use case: I have a containerized service that runs in a container. This service has several integration tests that make use of test containers. Some of these containers need to be able to read a file before starting so in the initialization of the GenericContainer I would use withCopyFileToContainer(MountableFile.forClassPathResource(...)) to copy a file from the container in which the tests run to the test container, but this does not work. The file is not being copied. I assume withCopyFileToContainer only works if it is being invoked on the host.