Skip to content
This repository was archived by the owner on Mar 7, 2025. It is now read-only.

Conversation

tarek369
Copy link
Contributor

fix coder by removing the command and adding user: "{{ uid }}:{{ gid }}"
otherwise, it was not working

@tarek369
Copy link
Contributor Author

should i push this to develop? i did it to master cuz its broken there

@mbryde
Copy link
Contributor

mbryde commented Apr 18, 2020

Pretty sure this is a duplicate of #213

@tarek369
Copy link
Contributor Author

No it has extra the user: "{{ uid }}:{{ gid }}"
It will not work without it ! Actually it will work but there will be issues to save any files with it and it was written somewhere in there documentation, they handle it by give the user and group from docker run

@codsane
Copy link
Contributor

codsane commented Apr 19, 2020

No it has extra the user: "{{ uid }}:{{ gid }}"
It will not work without it ! Actually it will work but there will be issues to save any files with it and it was written somewhere in there documentation, they handle it by give the user and group from docker run

@tarek369 Would you mind sharing where you saw that in the docs?

Only asking as after implementing the fix in #214 over 2 weeks ago I have yet to have any issues saving files or anything

Edit: I think I found it, this issue: coder/code-server#439 prompted a discussion which resulted in coder/code-server#640 and then coder/code-server#1425 which updated the example docker run command.

An important thing to note in the original issue which prompted the change:

  • coder (properly) adds a user to the image and ensures codeserver is executed as that user

  • this user will resolve to 1000:1000 in /etc/passwd in the container per ubuntu defaults

  • if you are lucky enough to be running on a host where your user id equals 1000, passing -u $(id -u) will just work; otherwise, which I assume is most cases, it will not

code-server should run atop Cloudbox perfectly fine with this configuration, as 1000:1000 is what also seems to be recommended in the wiki for custom containers: https://github.com/Cloudbox/Cloudbox/wiki/Add-Your-Own-Docker-Container-into-Cloudbox

@tarek369
Copy link
Contributor Author

Well I tried it two days ago and didn't work and I make those changes and it works now, as very coder GitHub docker run -it -p 127.0.0.1:8080:8080 -v "$PWD:/home/coder/project" -u "$(id -u):$(id -g)" codercom/code-server:latest

I know in cloudbox we add the user and group in env but for some reason it didn't work well with coder, I couldn't save anyfile with it, was giving permission error

@desimaniac
Copy link
Member

What's the verdict? Despite the Coder docs stating that it supports user/group, it breaks permissions?

@tarek369
Copy link
Contributor Author

Yes it break permissions

@codsane
Copy link
Contributor

codsane commented Apr 20, 2020

Yes it break permissions

@tarek369 You've said this many times but have yet to show where in fact this error occurs.

Again, an important thing to note in the original issue which prompted the change:

  • coder (properly) adds a user to the image and ensures codeserver is executed as that user

  • this user will resolve to 1000:1000 in /etc/passwd in the container per ubuntu defaults

  • if you are lucky enough to be running on a host where your user id equals 1000, passing -u $(id -u) will just work; otherwise, which I assume is most cases, it will not

code-server should run atop Cloudbox perfectly fine with this configuration, as 1000:1000 is what also seems to be recommended in the wiki for custom containers: https://github.com/Cloudbox/Cloudbox/wiki/Add-Your-Own-Docker-Container-into-Cloudbox

@tarek369
Copy link
Contributor Author

User is not be by default 1000:1000 ansible will get yours and will not set default 1000:1000 to solve the issue; I said the error will appear once you open coder and try to create files or edit on a file
One note I wasn't clear about I'm using Debian not Ubuntu so I'm not sure if this case on Debian only or no..
You can leave the pull request open and if someone else face the issue then merge it

@Migz93
Copy link
Contributor

Migz93 commented May 28, 2020

Please rebase against develop

@saltydk
Copy link
Contributor

saltydk commented Oct 12, 2020

Closed due to inactivity.

@saltydk saltydk closed this Oct 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants