Open coryb opened 11 months ago
Looks like a PR was created 7mo ago in Kaniko, but it is still unmerged https://github.com/GoogleContainerTools/kaniko/pull/2494
Maybe we can cherry pick this commit into the coder/kaniko fork?
Unfortunately, it looks like the upstream fix breaks user/group ownership in multi-stage builds.
Files being added to the workspace via
COPY
andADD
instructions in the dockerfile will end up with the original permissions from the workspace mount, not the correct defaultroot:root
file ownership.Note this is only when used with docker on Linux.
Here is a simple reproduction:
From the Dockerfile spec:
Likely caused by bug in Kaniko https://github.com/GoogleContainerTools/kaniko/issues/2850
The current hacky work-around is to force the --chown:
Which seems to do the "right" thing: