-
Notifications
You must be signed in to change notification settings - Fork 303
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
--update-mode=exec/container inconsistent file permissions #3708
Comments
Thanks for the report @leoluk! Let me dig into how this looks in our code and get back to you. |
Am I right in thinking that you set I agree that the different file permissions behavior between the two update modes isn't great :-/ but unfortunately a blanket solution of either "run all syncs/runs as root," OR "run all syncs and runs as the container user" is going to fail for some set of users. I might instead propose a Tiltfile-wide setting a la Unfortunately, I'm not sure we'll be able to prioritize this feature in the near term; does the workaround of running with |
Yes, the files in the container are owned by the unprivileged user. Agreed that it should be configurable.
Yes, the workaround works just fine. |
We're using Tilt with a docker-compose based setup (everything has been working perfectly), and we have this problem, only Would you have a workaround for this? I'm out of ideas at the moment.
I'd be happy with a parameter in the |
I just want to add my voice to those having issues with live updating using the root user rather than the user specified in the Docker file. My employer prefers us to use non-root users in our containers when possible, and having a process writing files as root is mangling our local dev environments. |
@TimothyLoyer that makes sense! If you're running on Kubernetes, a workaround is to invoke Tilt with |
I investigated this a bit. There's a couple of crisscrossing concerns here. The big one is that i.e., if you So whatever we do, we'll have to do the UID mapping ourselves. There's a few ways to do that. IMO, the best way to handle this is to use a docker exec API (similar to how we use kubectl exec API to copy files), and not use the docker cp APIs at all. The Docker APIs that map directly to the CRI tend to be very heavily used and battle-hardened...the ones that don't map to the CRI tend to be...softer. |
this should be fixed in 0.20.7 |
Problem
We use a Dockerfile that runs as non-root (i.e.
USER 1000
).With
--update-mode=container
, synced files are - presumably - created viadocker exec
as root and can't be read by the application user because they're owned by root.With
--update-mode=exec
, k8s defaults to the container user and everything works as expected.See also: #3060
Proposed Solution
Always use the container user to sync files
The text was updated successfully, but these errors were encountered: