-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
The .dockerignore file also matches between stages #595
Comments
I ran into the same issue. Here's my minimal test scenario Dockerfile: FROM alpine:3.9 AS intermediate
RUN cd /
RUN mkdir myDir
RUN echo "I am here!!!" > /myDir/shouldBeCopied.txt
FROM alpine:3.9
COPY --from=intermediate /myDir/shouldBeCopied.txt wasCopied.txt
RUN cat wasCopied.txt Dockerignore: # Each one prevents shouldBeCopied.txt from being copied (remove all these to make it work)
/myDir/shouldBeCopied.txt
/myDir
myDir
# Weirdly not a problem
shouldBeCopied.txt docker run -v ${PWD}:/project gcr.io/kaniko-project/executor:debug-c8fabdf6e43b19f6a223f1d0b06e127d0774bd7e executor --context project --dockerfile ./project/Dockerfile --no-push Expected output: Log message "I am here!!!" contained in the build log
|
We got this issue today as well. node_modules from the first step would not get copied to the next as long as it was present in .dockerignore |
Hitting this too. Particularly problematic if, like me, your |
Hit the same issue as @heroic with |
For sure not the best workaround, but I went with using the |
I ended up getting around this the same way @thewilli I'd love to actually help fix this, Is the logic simple between how docker cli handles this vs kaniko? I'll dig around but if someone could point me in the right direction I'd appreciate it. |
thanks all. i have a fix for this and will try to get this in by next release. |
that are great news - thanks a lot! @tejal29 |
@tejal29 is this fixed now? I noticed that |
@afirth no i have not merged the patch. i will get it in v0.19.0 |
@tejal29 Did you forget about this? 😞 |
The issue is still exist in version 0.19.0!! |
Just hit that issue for a first time - pretty frustrating. If real fix is delayed, this should at least be mentioned somewhere in docs. |
Sorry folks, this got dropped. Fix here -> #1234 |
Actual behavior
The patterns in
.dockerignore
match not only in workdir but also when copying between stages.Expected behavior
I expected kaniko to have the same semantics as in
docker build
.The patterns should match only on initial import relative to
/workdir/
not between stages relative to/
.To Reproduce
Trying the same with v0.7.0 or
docker build
works fine.The text was updated successfully, but these errors were encountered: