Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 432195

Summary: [terminal] Docker container UID and GID is not configurable
Product: [ECD] Orion Reporter: Mark Macdonald <mamacdon>
Component: DockerAssignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: ahunter.eclipse, gheorghe
Version: 5.0   
Target Milestone: 6.0 M1   
Hardware: PC   
OS: Windows 7   
Whiteboard:

Description Mark Macdonald CLA 2014-04-07 16:39:01 EDT
I'm trying out the internal Docker test server and having some permissions issues. My steps are:

1. Create new Orion account
2. Create a project named "ZZzz"
3. Go to terminal/terminal.html
4. I don't have permission to edit my project.

Here are the project permissions. Note the owner (1002) and group (1003)

 mamacdon2:~[21] % ll -d Z*                            
 drwxr-xr-x 2 1002 1003 4096 Apr  7 20:27 ZZzz/         

This is my user/group info:

 mamacdon2:~[17] % id 
 uid=1000(mamacdon2) gid=100(users) groups=100(users)
Comment 1 Anthony Hunter CLA 2014-04-08 17:04:04 EDT
This problem was fixed on the "internal Docker test server". I made changes in Bug 430328 but forgot to reflect those changes on this server.

The user that runs the orion server is userid 1000 and the user is in the users group with groupid 100.
Comment 2 Anthony Hunter CLA 2014-04-09 12:02:41 EDT
Since by default the first user created using the adduser command on Ubuntu is UID 1000 I just assumed that you could set up Orion to run as UID 1000. This was a bad assumption and we already have had two internal Docker test servers where Orion is not running as UID 1000.

Looks like we need two more settings in the orion.conf:
orion.core.docker.uid=1002
orion.core.docker.gid=1003
Comment 3 Anthony Hunter CLA 2014-04-10 10:46:06 EDT
(In reply to Anthony Hunter from comment #2)
> Looks like we need two more settings in the orion.conf:
> orion.core.docker.uid=1002
> orion.core.docker.gid=1003

Fixed with commit:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=04404876f948aa1e98f218386513692e219f095b
and
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=8983f1a8ddf938ea9ead4ac83435663c3f0f9ef9

The default UID is 1000 and GID is 100 unless you override.
Comment 4 Anthony Hunter CLA 2014-04-10 10:46:30 EDT
(In reply to Anthony Hunter from comment #2)
> Looks like we need two more settings in the orion.conf:
> orion.core.docker.uid=1002
> orion.core.docker.gid=1003

Fixed with commit:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=04404876f948aa1e98f218386513692e219f095b
and
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/commit/?id=8983f1a8ddf938ea9ead4ac83435663c3f0f9ef9

The default UID is 1000 and GID is 100 unless you override.
Comment 5 Anthony Hunter CLA 2014-04-10 16:40:13 EDT
(In reply to Anthony Hunter from comment #4)
> The default UID is 1000 and GID is 100 unless you override.

I thought it would be "smart" to use a GID that already existed in base ubuntu /etc/group. From the adduser manpage:
By default, each user in Debian GNU/Linux is given a corresponding group with  the same name and id.

So almost definitely the group will not be 100. Need to fix again, the default on a clean system will be 1000.