make COPY
copy as the set USER
when using a Containerfile to build a container
#5864
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
Feature request description
For now, the following:
results in
file_inside_container
to be owned byroot:root
. This feels inconsistent with the fact thatUSER
is set. The workaround is to write:which feels quite heavy / more error prone than just having a "context" set by
USER
.Suggest potential solution
Would it be possible to consider changing the behavior of
COPY
, so that it follows the context set by the last precedingUSER
directive?I.e. that:
results in
file_inside_container
to be owned byusername:username
?
Have you considered any alternatives?
For now the solution is:
but that feels ugly / heavy / error prone when after a
USER
directive one thinks commands happen asUSER
.Additional context
No response
The text was updated successfully, but these errors were encountered: