Skip to content
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: resolve issue around copying root #2592

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aaron-prindle
Copy link
Collaborator

@aaron-prindle aaron-prindle commented Jun 20, 2023

Changes taken from @kvaps PR here: #1724. Re-submitting here as that PR required rebasing and was no longer active there. Original description added below:

Fixes #960

Description

This PR updates otiai10/copy module from v1.0.2 to v1.6.0.
Adds option to not copying ignored paths for CopyFileOrSymlink which solves two problems at once:

  • Allows copying root (/)
  • Avoid leaking docker credentials using COPY command while building the image.

It might need rebase after merging #1725.
This branch includes both fixes: kvaps:fix-copying-root-and-ownership; compiled docker images:

ghcr.io/kvaps/kaniko-executor:v1.6.0-fix
ghcr.io/kvaps/kaniko-executor:v1.6.0-fix-debug
ghcr.io/kvaps/kaniko-warmer:v1.6.0-fix

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes unit tests
  • Adds integration tests if needed.

See the contribution guide for more details.

Reviewer Notes

  • The code flow looks good.
  • Unit tests and or integration tests added.

Release Notes

Describe any changes here so maintainer can include it in the release notes, or delete this block.

- Add additional check for ignored files on COPY
- Support copying root (`/`) of image

Additional ideas here related to this:
#960 (comment)

@aaron-prindle aaron-prindle mentioned this pull request Jun 20, 2023
4 tasks
@lc-guy
Copy link

lc-guy commented Sep 15, 2023

This branch still has issues for me.

Without the fix:

INFO[0166] Saving file . for later use                  
error building image: could not save file: copying file: read /dev/autofs: invalid argument

With the fix:

INFO[0159] Saving file . for later use                  
error building image: could not save file: copying ownership: chown /kaniko/0/__cacert_entrypoint.sh: no such file or directory

@lc-guy
Copy link

lc-guy commented Feb 2, 2024

Now that #2863 has been merged, the above issue with files in /kaniko has been fixed. Would it be possible to look into merging this (@aaron-prindle)?

@dobicinaitis
Copy link

I just encountered the same issue with multi-stage builds that use layer squashing via the COPY --from=final / / method.
Was pleased to find that there's already a fix for this, but it appears that the PR has become inactive. @aaron-prindle is there a possibility that the changes could be rebased and merged for the next release?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kaniko is stucking on copying root
3 participants