my.tar contains files owned by user 0, I want them to be owned by nobody:
USER nobody
ADD --chown nobody:nobody my.tar /app
Damn, --chown does not work when untaring and doesn't fail either but the files end up being owned by root. Fine, I'll just chmod
USER nobody
ADD my.tar /app
RUN chmod -R nobody:nobody /app
Now it fails (of course) because the files are owned by root and the command is ran as nobody.
While it all makes sense, I'm not sure why it's logic to have the ADD command always run as root and the others following the USER directive (yeah and I know, it's all my bad for using ADD rather then COPY)
Ah well, no I did not know, thanks :) in my case it's not too bad because I use kaniko's option to make a single layer of my changes, but good to know.
my.tar contains files owned by user 0, I want them to be owned by nobody:
Damn, --chown does not work when untaring and doesn't fail either but the files end up being owned by root. Fine, I'll just chmod Now it fails (of course) because the files are owned by root and the command is ran as nobody.While it all makes sense, I'm not sure why it's logic to have the ADD command always run as root and the others following the USER directive (yeah and I know, it's all my bad for using ADD rather then COPY)