Skip to content

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

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.

Activity

  1. aidando73 commented on Aug 25, 2022

    @aidando73
    Contributor

    Hi @csa777 do you have a code snippet of what you mean? I'm having a trouble visualizing your setup.

  2. locked and limited conversation to collaborators on Aug 25, 2022
  3. converted this issue into a discussion #5770 on Aug 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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