Skip to content

How should I copy a file from a container to another container? #5403

@csa777

Description

@csa777

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions