(docker assets): .dockerignore is processed incorrectly before 1.73.0 and broken after 1.73.0 #13636
Labels
@aws-cdk/assets
Related to the @aws-cdk/assets package
bug
This issue is a bug.
closed-for-staleness
This issue was automatically closed because it hadn't received any attention in a while.
effort/small
Small work item – less than a day of effort
p1
I'm using
ContainerImage.fromAsset
to build a Docker image out of my source code, but the .dockerignore file is not correctly processed. My source tree is roughly as follows:project:
.dockerignore
contains:When using version 1.93.0, and looking at what is copied over to cdk.out I see the following:


This means that only the . folders and files are copied over, completely ignoring what is in .dockerignore. I manage to locate this issue starting from version 1.73.0. In 1.72.0 I see the following, which is also incorrect:
this is practically copying over all my files and again completely ignoring what is in .dockerignore. This is particularly a problem since I ask for everything to be ignored besides that jar. When I keep the .dockeringore file as it is above, cdk will try to copy everything to cdk.out including cdk.out, which is part of the infra directory and there we get a hell loop that of course breaks with the error:
In order to avoid this error, I have to add the infra directory to the .dockerignore file explicitly, like this:
but it and everything that isn't the jar should've been ignored by **.
What did you expect to happen?
I expected the .dockeringore to be processed (correctly) because of this comment: #5807 (comment). I haven't seen anything like this as part of the documentation.
What actually happened?
Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: