che icon indicating copy to clipboard operation
che copied to clipboard

Eclipse Che - Set container in privileged mode

Open MuraliVidhya opened this issue 9 years ago • 8 comments

Hi,

With the latest version of che5.8.0 - when i tried to set PRIVILEGED MODE -> it does not work

  1. docker run -it --rm -v /usr/local/codenvy/chedata:/data -v /var/run/docker.sock:/var/run/docker.sock eclipse/che start
  2. edit - /usr/local/codenvy/chedata/che.env set CHE_DOCKER_PRIVILEGED = true 3.restart che server container 4.docker inspect ce4 |grep CHE_DOCKER_PRIVILEGED => does not return anything.

What's wrong here ..

MuraliVidhya avatar Apr 18 '17 08:04 MuraliVidhya

It is working. That flag enables privileged mode for containers created by Che when you start a workspace. It is not for the Che container itself.

Tyler

On Apr 18, 2017, at 3:35 AM, mvidhya86 [email protected] wrote:

Hi,

With the latest version of che5.8.0 - when i tried to set PRIVILEGED MODE -> it does not work

docker run -it --rm -v /usr/local/codenvy/chedata:/data -v /var/run/docker.sock:/var/run/docker.sock eclipse/che start edit - /usr/local/codenvy/chedata/che.env set CHE_DOCKER_PRIVILEGED = true 3.restart che server container 4.docker inspect ce4 |grep CHE_DOCKER_PRIVILEGED => does not return anything. What's wrong here ..

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

TylerJewell avatar Apr 18 '17 08:04 TylerJewell

Hi @TylerJewell - thanks for your comment. why is the value not true for this case docker inspect ce4 |grep CHE_DOCKER_PRIVILEGED. How do i confirm that CHE_DOCKER_PRIVILEGED is set for workspaces

MuraliVidhya avatar Apr 18 '17 08:04 MuraliVidhya

You can start a workspace and then do something inside that workspace which requires privileged mode to verify it. After the workspace has started you can inspect the new container. There is no value in inspecting the Che container itself.

Tyler

On Apr 18, 2017, at 3:46 AM, mvidhya86 [email protected] wrote:

Hi @TylerJewell - thanks for your comment. why is the value not true for this case docker inspect ce4 |grep CHE_DOCKER_PRIVILEGED. How do i confirm that CHE_DOCKER_PRIVILEGED is set for workspaces

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

TylerJewell avatar Apr 18 '17 09:04 TylerJewell

Hi, i have doubt whether i properly set CHE_DOCKER_PRIVILEGED. after setting it to true in che.env => i did docker restart of che server container. As per the configuration docs - "run che config to apply this configuration to your system. che start also reapplies the latest configuration" - how do i check this

Also for me after creating workspace - privileged mode does not reflect (e.g. c++ stack does not enable debugger). Inspecting workspace container neither returns value for docker inspect cid |grep CHE_DOCKER_PRIVILEGED

MuraliVidhya avatar Apr 18 '17 09:04 MuraliVidhya

@mvidhya86 just checked - privileged mode works fine for me. To set privileged mode just set CHE_DOCKER_PRIVILEGED=true in che.env and restart Che. To ensure that your workspace is running in privileged mode just inspect workspace container: docker inspect <your workspace container> | grep Privileged

mmorhun avatar Apr 18 '17 09:04 mmorhun

Hi @mmorhun How did you restart Che - by docker restart command or che stop and start commands. Could you help me here .. docker inspect | grep Privileged => returns false for both Che server container and workspace container. I think changes i did in che.env are not reflecting correctly to workspace container

MuraliVidhya avatar Apr 18 '17 10:04 MuraliVidhya

@mvidhya86 I restarted Che with restart cli command. But you can use stop and then start as well, up to you. Privileged mode is applied only to your workspaces not to Che server. To apply privileged mode:

  1. Stop your workspace and Che server.
  2. Edit che.env, set CHE_DOCKER_PRIVILEGED=true (check property name carefully or just copy paste it; make sure that you remove # symbol in the sample if you use it). Save changes to che.env file.
  3. Start Che server, start your workspase.
  4. Open an terminal and inspect your workspace container (not Che server). Now it should be started in privilage mode.

mmorhun avatar Apr 18 '17 10:04 mmorhun

Thanks, workspace container inspect works fine and shows Privileged as true

MuraliVidhya avatar Apr 18 '17 11:04 MuraliVidhya