coder / sail

Deprecated: Instant, pre-configured VS Code development environments.
https://sail.dev
MIT License
627 stars 36 forks source link

/usr/bin/code-server: Permission denied #209

Open yohcop opened 5 years ago

yohcop commented 5 years ago

I have a very simple .sail/Dockerfile in my project:

FROM codercom/ubuntu-dev:latest

But when I run sail, I get permission denied on code-server.

> sudo sail run --ssh git@gitlab.com/yohcop/tri-report.git
2019-06-01 11:32:45 INFO    running docker build --network=host -t yohcop_tri-report -f /home/y/Projects/yohcop/tri-report/.sail/Dockerfile /home/y/Projects/yohcop/tri-report --label com.coder.sail.base_image=yohcop_tri-report
Sending build context to Docker daemon  2.715MB
Step 1/2 : FROM codercom/ubuntu-dev:latest
 ---> 1c089a10e31f
Step 2/2 : LABEL com.coder.sail.base_image=yohcop_tri-report
 ---> Using cache
 ---> e43a8b060529
Successfully built e43a8b060529
Successfully tagged yohcop_tri-report:latest
2019-06-01 11:32:45 INFO    using repo image yohcop_tri-report
2019-06-01 11:32:45 INFO    writing sail proxy logs to /tmp/sailproxy_yohcop_tri-report955191676
2019-06-01 11:32:45 ERROR   failed to wait for project to be online: container yohcop_tri-report not running
+ cd /home/user/tri-report
+ sudo chown user:user /home/user/.vscode
+ tee /tmp/code-server.log
+ code-server --host localhost --port 0 --data-dir /home/user/.config/Code --extensions-dir /home/user/.vscode/host-extensions --extra-extensions-dir /home/user/.vscode/extensions --allow-http --no-auth
bash: line 5: /usr/bin/code-server: Permission denied
2019-06-01 11:32:45 ERROR   build run failed: container yohcop_tri-report not running

The weird thing is if I run sudo docker run -it yohcop_tri-report bash, and then try to run /usr/bin/code-server, with with all the flags (except --extra-extensions-dir, which seems to be problematic), it starts fine. I also checked the permissions, and they are set correctly

-rwxr-xr-x 1 root root 94698820 Apr 24 00:18 /usr/bin/code-server

So it's probably a permission denied on something else.

Any ideas? Thanks!

nathanpotter commented 5 years ago

could you provide the output of the docker logs for the failed container startup?

sr229 commented 5 years ago

@nathanpotter we don't need the docker logs, the logs alone above already tells the issue.

Looks like the code-server binary has no executable permissions. Probably an error in how it was chmod'ed