-
-
Notifications
You must be signed in to change notification settings - Fork 511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Files don't work when copying from outside running directory #673
Comments
Hi @arjenvdhave sorry for the radio silence, I started paternity leave on Dec 10th, until the end of January. I'm going to check the repro code you shared. Will ping you here with my results |
Mmm IIUC your expectations are on the contents of the TAR file produced by the So, given this example:
you would expect all the files, and subdirs to be hanging from migrations, only, and the current behaviour keeps the original path. Is this correct? If so, I'm able to reproduce it in the current tests, passing an absolute path as the Thanks for the report! |
I think I have a working prototype, but want check with you all first: do we expect that the TAR file should compress the file from the last directory from If so, using your example "/home/myname/migrations/", will create a TAR file from migrations, not containing the previous, parent file paths. If this assumption is correct, simply changing how the current TAR code generates the file headers would be enough |
This sounds like how i expect it should be working. if I do |
Makes sense to me. I'm preparing a PR now |
@arjenvdhave feel free to comment on the PR 🙏 A review is also much appreciated |
Tnx, i looked at the code and it looks ok so not sure if my opinion is trust worthy 😂 |
Testcontainers version
v0.16.0
Using the latest Testcontainers version?
Yes
Host OS
Linux
Host arch
x86_64 GNU/Linux
Go version
1.19
Docker version
Docker info
What happened?
When using the Files to copy a directory from my host to the container it doesn't copy the contents of the dir but the complete path.
I expect that the contents of
/home/myname/migrations/
is copied into/tmp
in the container.Instead it creates
/tmp/home/myname/migrations/
I also tried using
../../migrations
as a path but this would create amigrations
dir in the root instead of in the configured/tmp
Relevant log output
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: