-
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
RUN chmod 777 on /var/run yields differing permissions; Kaniko vs Docker engine build #1127
Comments
looks like, this issue is specific to symlinks. The second output screenshot which you provided, is this for
|
Correct, its symlink related. That is |
@bitsofinfo please provide your dockerfile. /cc @tstromberg |
Unfortunately I cannot share the dockerfiles as-is as it derives from other private images etc. |
Hi @bitsofinfo, Did you use the flag
|
Thanks. I did not use that flag. So you are saying that flag is required to do what I'm trying to do? Why would this not just work by default? |
I believe that by default (=without setting the flag to false), /var/run will not be part of the file-system snapshot taken after some of the commands. There's some explanation in fs_util.go, but perhaps @tejal29 could elaborate on why this is required. Intuitively, I agree that setting "whitelist = false" for a directory you do want to include is confusing... Specifically in your case, without seeing the Dockerfile it's hard to guess at what stage /var/run "reappears" in the file-system. I can just say that the sample Dockerfile I attached couldn't be build with kaniko because Does adding the flag produces correct build? |
@bitsofinfo After a further research, I wanted to provide a small clarification: the flag In any case, seems like running chmod on the symlink works on an arbitrary image. Please let me know if I can help in any way. |
@bitsofinfo I verified your dockerfile on the latest build with
The build is successful and the permissions are right. |
Dockerfile built w/ docker 19.03.4 yields an image who has these expected permissions:
The Dockerfile does a
RUN chmod 777 /var/run
Contents of /var in image build by Docker 19.03.4
Image built w/ kaniko 0.15.x or 0.18.0:
Contents of /var
My app breaks because it runs as non-root, the statement in the Dockerfile
RUN chmod 777 /var/run
is intended to set this.Why does it work on Docker engine builds but not kaniko?
Kaniko perms:
Docker built perms:
The text was updated successfully, but these errors were encountered: