Skip to content

Copy directory doesn't work with 'ImageFromDockerfile.withFileFromPath(...)' #285

Closed

Description

@tourea

In my Dockerfile, I have something similar to:
COPY ./folder /path/to, where folder is a directory.
When I try to start a generic container (using ImageFromDockerfile), I get an exception in ImageFromDockerfile:

Caused by: java.lang.RuntimeException: Can't transfer file ...
  at org.testcontainers.images.builder.traits.FilesTrait$1.transferTo(FilesTrait.java:43)
  ...
Caused by: java.io.IOException: Is a directory

Activity

  1. rnorth commented on Feb 2, 2017

    @rnorth
    Member

    Ouch - sorry. Let's try and solve this with #279, which gives us a good chance to clean up file/resource handling for good.

  2. self-assigned this
    on Feb 2, 2017
  3. rnorth commented on Feb 19, 2017

    @rnorth
    Member

    Hi @tourea
    Sorry it's taken a while to give you an update on this - it's turned out quite a bit harder than I initially thought. However, I have some draft code on a branch which allows recursive copying of files in.

    You can see an example here.

    I'll keep working on this and tidying up - if you really want to try it in the meantime you could use jitpack to obtain a branch build (https://jitpack.io/#testcontainers/testcontainers-java/285-recursive-tar-copy-SNAPSHOT should work)

    @bsideup FYI - this branch is too messy to deserve review yet. However, you might want to know that (so far) I had to make some fairly big changes to Transferable to allow enough flexibility for recursively populating the context TAR. I will make some further changes to the interface hierarchy, but thought I should give you a heads-up.

    Richard

  4. rnorth commented on Mar 13, 2017

    @rnorth
    Member

    This change is getting closer to being ready; I'd hope to get it released soon. Sorry for the long wait on this.

  5. dbyron0 commented on Apr 14, 2017

    @dbyron0
    Contributor

    The 'This change' link in your comment (https://github.com/testcontainers/testcontainers-java/issues/!313) doesn't work for me. This one does though.

  6. stale commented on Oct 28, 2018

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this.

  7. rnorth commented on Oct 28, 2018

    @rnorth
    Member

    Support for this was added in #313 so I shall close.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions