Open JonJam opened 4 weeks ago
Thanks for raising a detailed issue @JonJam, I can also reproduce it.
Looks like the dockerignore
function from @balena/dockerignore
works correctly by adding the correct rule, but the callback from tar.pack
does not give the full path (example7/nested/file.txt
), only the enclosing dir (example7/nested
) which does not result in a match.
No problem @cristianrgreco.
Sorry I forgot to add a note that I confirmed @balena/dockerignore
works as expected in a node playground :)
Expected Behaviour When using a
.dockerfile
as follows:The above directories and files should be included in the build context.
Actual Behaviour
example4/nested
directory andexample5/example5.txt
are missingSteps to Reproduce Define this test in checkout of repo:
Update
.dockerignore
intestcontainers-node-main/packages/testcontainers/fixtures/docker/docker-with-dockerignore/.dockerignore
with:The test will fail with:
Debug notes
It seems like
tar.pack
is the issue, as it doesn't go into subdirectories: