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 where kaniko would fail if user attempted to create /workspace directory #2686

Closed

Conversation

aaron-prindle
Copy link
Collaborator

@aaron-prindle aaron-prindle commented Aug 18, 2023

Fixes #1508

Context:
#1508 (comment)

Currently a /workspace folder is created when kaniko is run as it is the WORKDIR for the kaniko image. This /workspace folder is deprecated though currently, this directory was renamed /kaniko and it is unclear if the WORKDIR should be set at all for users IIUC. This change removes a WORKDIR from being set which fixes issues where kaniko could not create a /workspace directory as it already existed from it being set as the image's WORKDIR

@JeromeJu JeromeJu self-assigned this Oct 10, 2023
@JeromeJu
Copy link
Collaborator

JeromeJu commented Oct 10, 2023

Thanks for the fix @aaron-prindle . From the integration tests it seems that we might want to add /workspace for https://github.com/GoogleContainerTools/kaniko/blob/main/integration/dockerfiles/Dockerfile_relative_copy after the change IIUC.

@aaron-prindle
Copy link
Collaborator Author

aaron-prindle commented Oct 10, 2023

@JeromeJu thanks for the info here! I am hesitant to make this change currently as this test outlines a potential issue where changing the Kaniko image to no longer set the WORKDIR to /workspace might break some users/Dockerfiles that rely on the current functionality.

Additionally this test Dockerfile_relative_copy is essentially testing that WORKDIR is auto-prefixed for relatvie path COPY and would not make sense to change to /workspace (as the test would no longer test relative_copy. Still debating the best thing to do here, it might make sense to simply remove this as it no longer makes sense or have a special kaniko image with a WORKDIR set to test this functionality even if the default image doesn't set it

@aaron-prindle
Copy link
Collaborator Author

Going to close this for now until I have more definitive information on the potential user breakage vs the fix upside (Dockerfiles created /workspace work)

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.

If a dockerfile has a step to create a directory /workspace, kaniko fails
2 participants