-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Support docker run with --user $(id -u):$(id -g) cli arg (shared process error) #439
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
Comments
after educating myself a bit on docker user and group management, this does not appear to be something that is fixable by codercom devs. I will be closing this issue. Here's a brief synopsis:
in short docker is doing what it's supposed to, and my uid does not resolve to the uid that codeserver is instructed to run as. We are discussing other approaches as passing the -u $(id -u) flag does not seem like something that will scale appropriately, particularly for third party images. |
If you are building your own Docker image you can designate what user you want the container to use in your Dockerfile. |
Unless I'm mistaken you would need to have a custom docker build for every user in the organization that wants to use code server with this approac. This could be in the thousands in our world, and is not scalable. The core requirement is dynamic uid/guid resolution to be mapped at runtime, not build time. Ideally a single hosted instance could support multiple users, obviating the need for this, which seems like it's being investigated: Until then we are looking at podman.io, or possibly creating our own image that includes a PAM module that could resolve our UIDs from a directory server. Or even potentially an approach like fixid: https://boxboat.com/2017/07/25/fixuid-change-docker-container-uid-gid/. Very early days for us. |
Cool, re-opened. I think I see the approach here per your openshift fork. I noticed that you're doing an append to the container /etc/passwd file based on uid:guid in the entry point script. I've done similar in my fork, but using a sudo groupmod so we don't keep appending duplicate entries: I'm currently at a very low bandwidth area and can't build the docker image to test - when I can I'll post back. |
Any update on this @satlus ? |
I was able fiddle with this today, and I couldn't get an approach using disclaimer: I shouldn't be considered authoritative on this subject I'm experimenting. I'll play around a bit more, but including trying sr229's approach |
If I supply
|
If you scroll horizontally in the example I posted that invokes the I think you will still hit the shared process issue I originally reported, which is ultimately due to this: |
I guess https://github.com/boxboat/fixuid can help resolve the UID/GID issue at least. |
This looks great. I was just now coming across this same issue with mounted partitions. I am about to try that out right now. It seems extremely useful in many situations. Thanks for the link. : D |
added fixuid in my branch, and it's working in my test environment. I've submitted a PR for review here: @kylecarbs let me know what you think |
You beat me to this PR @satlus, good job! 👍 I have provided some feedback in the PR, but I am no authority on this repo. |
CC @satlus I'll be including your modifications in my Docker image so people can pre-test it and have their feedback. |
The thing is I'll be re-modifying it to use a production image of the editor will update when I have a working image. |
Wanted to add my band-aid for this problem by overriding the entrypoint with the following script.
|
Will deal with this soon. See #1307 |
Test environment
Host OS: OSX 10.14.4
Docker: 2.0.0.3 (31259)
image: codercom/code-server:1.621
Request
Hi,
We run docker in a locked down environment where we alias the$(id -u):$ (id -g) on all host operating systems. This is a security constraint we can't remove. When i try to execute code server simulating this environment it throws a shared process error. Any ideas on an approach to resolve?
docker run
cli command to prepend --userRepro
The text was updated successfully, but these errors were encountered: