-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Re-fix #2767 #7012
Re-fix #2767 #7012
Conversation
The example of |
Reproduce:
The log will be like as follow:
|
Thank you for the PR! Do you know what exactly causes the bug? I tried to reproduce with
Maybe it is the It seems like the way for the bug to trigger is if |
You can create another normal user, one with a UID not equal to |
I noticed that Perhaps |
I found the reason for "running as root" because I defined services:
code_server:
extends:
file: ./docker-compose.example.yml
service: code_server
user: root
pid: host
ipc: host
cap_add:
- ALL
security_opt:
- apparmor=unconfined Then I disabled some features by commenting out some fields. services:
code_server:
extends:
file: ./docker-compose.example.yml
service: code_server
# user: root
# pid: host
# ipc: host
# cap_add:
# - ALL
security_opt:
- apparmor=unconfined Yes, the official code works fine with a custom UID. |
Ohh interesting! If it runs as root, is that a sign that something else is wrong? Either way, it seems reasonable to use # Rename coder user to the name in DOCKER_USER if DOCKER_USER does not already exist.
if ! id -u "$DOCKER_USER" 2>/dev/null ; then |
Because the command will print the UID when it begins to check, I have replaced it with the code as below. if [ -z "$(id -u "$DOCKER_USER" 2>/dev/null)" ]; then Test case:
ALL PASSED! Cheers! |
Sorry for the delay, thank you for fixing this and for the thorough testing! This will be published soon, I think in the next few days after the release candidate has had time to sit. |
Cannot start stopped docker container, user 'coder' does not exist