-
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
fix: exclusion files during COPY statement #1510
fix: exclusion files during COPY statement #1510
Conversation
CI failures:
|
Thanks @alex1989hu. i will retry the runs. |
When using `COPY --from`, do not exclude files from `dockerignore` Credites goes to Pieter Lexis (@pieterlexis) Signed-off-by: Alex Szakaly <alex.szakaly@gmail.com>
@@ -0,0 +1,5 @@ | |||
FROM scratch as src | |||
COPY . / |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this '.' is causing the no space left error.
Can yo instead re-write the existing test Dockerfile_test_dockerignore
# This dockerfile makes sure the .dockerignore is working
# If so then ignore/foo should copy to /foo
# If not, then this image won't build because it will attempt to copy three files to /foo.txt, which is a file not a directory
FROM scratch as base
COPY ignore/* /foo.txt
From base as first
COPY --from=base /foo.txt ignore/bar
# Make sure that .dockerignore also applies for later stages
FROM scratch as base2
COPY ignore/* /foo.txt
From base2 as second
COPY --from=base2 /foo.txt ignore/bar
FROM scratch
# Test make sure, dockerignore is not applied with `-from`
COPY --from=first ignore/* /fooAnother/
COPY --from=second ignore/* /fooAnother2/
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
@googlebot I consent |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
1 similar comment
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
All (the pull request submitter and all commit authors) CLAs are signed, but one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that by leaving a comment that contains only Note to project maintainer: There may be cases where the author cannot leave a comment, or the comment is not properly detected as consent. In those cases, you can manually confirm consent of the commit author(s), and set the ℹ️ Googlers: Go here for more info. |
Didn't I already fix this with #1447 where the excludes are now part of the FileContext? Or more specifically, didn't #1234 already fix this? Which made #1447 necessary for some unrelated fixes? |
This PR probably solving the same issue, I solved in #1724 However I think my solutions might be better as it not even saving the ignored files into cached layer, take a look at this: |
Relates to (and quite possibly fixes) #552 and #1280.
Description
The original PR is here: #1312
When using
COPY --from
, do not exclude files fromdockerignore
Credites goes to Pieter Lexis (@pieterlexis)
Signed-off-by: Alex Szakaly alex.szakaly@gmail.com
Submitter Checklist
These are the criteria that every PR should meet, please check them off as you
review them:
See the contribution guide for more details.
Reviewer Notes
Release Notes
Describe any changes here so maintainer can include it in the release notes, or delete this block.