-
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
COPY --chown=1001:0 . . copies directories as root #2035
Labels
area/dockerfile-command
For all bugs related to dockerfile file commands
area/permissions
area/uid
categorized
cmd/copy
differs-from-docker
feat/copy-chown
feat/docker-syntax
issue/chown
issue/USER
kind/bug
Something isn't working
priority/p1
Basic need feature compatibility with docker build. we should be working on this next.
work-around-available
works-with-docker
Comments
I can confirm this behaviour also for copies of sub-folders (not the entire WORKDIR): COPY --chown=nobody:nobody server_configs merge_server_configs |
We also encountered this issue, please fix this. Dockerfile: FROM dockcenter/velocity:3.1.2-SNAPSHOT-153
COPY --chown=velocity lang /data/lang
COPY --chown=velocity plugins/gate/build/libs/*.jar /data/plugins/ |
I've "solved" this by explicitely calling chwon through # move over package.json and package-lock.json, and install dependencies
COPY --chown=node:node package*.json ./
# kaniko ignores the --chown from the previous command
RUN chown -R node:node .
RUN npm ci |
aaron-prindle
added
differs-from-docker
works-with-docker
kind/bug
Something isn't working
area/permissions
cmd/copy
area/dockerfile-command
For all bugs related to dockerfile file commands
priority/p1
Basic need feature compatibility with docker build. we should be working on this next.
work-around-available
labels
Jun 12, 2023
aaron-prindle
added
area/uid
feat/docker-syntax
feat/copy-chown
possible-dupe
ok-to-close?
categorized
and removed
possible-dupe
ok-to-close?
labels
Jun 26, 2023
Looks like this cannot be reproduced at HEAD for kaniko v1.20.x where the directories users are also non-root.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/dockerfile-command
For all bugs related to dockerfile file commands
area/permissions
area/uid
categorized
cmd/copy
differs-from-docker
feat/copy-chown
feat/docker-syntax
issue/chown
issue/USER
kind/bug
Something isn't working
priority/p1
Basic need feature compatibility with docker build. we should be working on this next.
work-around-available
works-with-docker
Actual behavior
I want to transfer all files and dirs recursively from current host dir to WORKDIR inside the image
I am using
COPY --chown=1001:0 . .
Expected behavior
All files and folders in the image should be owned by user with ID 1001 and group 0.
To Reproduce
Steps to reproduce the behavior:
ls -ls
When built with kaniko 1.8.0, all files belong to user non-root and all directories belong to user root.
When built with Docker 20.0.13, all files belong to user non-root and all directories also belong to user non-root.
Additional Information
Triage Notes for the Maintainers
--cache
flagThe text was updated successfully, but these errors were encountered: