-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
CLI - set uid:gid of Che and workspaces #4050
Conversation
Build success. https://ci.codenvycorp.com/job/che-pullrequests-build/1905/ |
You should mount /etc/passwd and /etc/group. |
Signed-off-by: Tyler Jewell <tjewell@codenvy.com>
Build # 1930 - FAILED Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/1930/ to view the results. |
Yes but the expectation we discussed with Mario was that if you set the Che server to run under a single user we would enforce that with workspaces to have the same as well. So we are missing that coupling. |
Build success. https://ci.codenvycorp.com/job/che-pullrequests-build/1940/ |
You are right, but this PR can be tested/applied without #3376. If we use --user , the che server should start as user. When we apply #3376, a workspace should be started as user. I have tried to start che using your PR.
Call the following commands to run the che server as an user:
Che-cli creates the following docker-compose.yml:
and adds the following env variable to che.env
We have to mount /etc/passwd and /etc/group when running che-cli. Otherwise, che-cli will return an error. |
Signed-off-by: Tyler Jewell <tjewell@codenvy.com>
Signed-off-by: Tyler Jewell <tjewell@codenvy.com>
Thanks for the pointers @snjeza. I did some refactoring to make the code more manageable long term. It was ok on my windows machine. I also provided the ability to set the uid:gid through either use of |
Build success. https://ci.codenvycorp.com/job/che-pullrequests-build/1974/ |
It works fine. |
@l0rd - what is the merge plan here? At a minimum we should wait for 5.3 to release tomorrow. Will we also co-release this with the changes that allow for setting user identity within a workspace, too or should we merge this separately? |
Build # 1993 - FAILED Please check console output at https://ci.codenvycorp.com/job/che-pullrequests-build/1993/ to view the results. |
Signed-off-by: Tyler Jewell <tjewell@codenvy.com> * Update docker-compose.yml.erb * Add uid checks
Signed-off-by: Tyler Jewell tjewell@codenvy.com
What does this PR do?
This PR adapts the Che CLI to support letting users provide a different uid:gid combination to be applied to the Che server and its resulting workspaces. Users can pass
--user uid:gid
on thedocker run ...
command line and this will be passed into the eclipse/che-server container. If no user is provided, the default is set to root.This feature should only be used with Linux hosts and will have odd behaviors on Windows.
What issues does this PR fix or reference?
Only merge this PR when the user improvements of @snjeza are merged.
#3376
Changelog
Add
--user uid:gid
and-e CHE_USER=uid:gid
option to CLI to override user identity of Che containerRelease Notes
You can now run Eclipse Che's container with a different user identity on Linux or Mac. The default is to run the Che container as a root user. You can now pass
--user uid:gid
or-e CHE_USER=uid:gid
on the command line as Docker options to theeclipse/che
Docker image. This image will launch theeclipse/che-server
image with the sameuid:gid
combination along with mounting/etc/group
andetc/passwd
. When Che is run as a user, all files written from within the Che server to the host (such asche.env
orcli.log
will be written to disk with the custom user as the owner of the files. Changing the user is not available on Windows.Docs PR
N/A - covered by the main PR