You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Copy directory doesn't work with 'ImageFromDockerfile.withFileFromPath(...)' #285
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
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.
@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.
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.
Activity
rnorth commentedon Feb 2, 2017
Ouch - sorry. Let's try and solve this with #279, which gives us a good chance to clean up file/resource handling for good.
rnorth commentedon Feb 19, 2017
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
Transferableto 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
rnorth commentedon Mar 13, 2017
This change is getting closer to being ready; I'd hope to get it released soon. Sorry for the long wait on this.
dbyron0 commentedon Apr 14, 2017
The 'This change' link in your comment (https://github.com/testcontainers/testcontainers-java/issues/!313) doesn't work for me. This one does though.
stale commentedon Oct 28, 2018
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.
rnorth commentedon Oct 28, 2018
Support for this was added in #313 so I shall close.