Code-server: OCI runtime create failed: container_linux.go:345

Created on 27 Jun 2019  路  8Comments  路  Source: cdr/code-server

env

os:ubuntu 16.04
docker: 18.09.4
code-server version: latest version in Jun 27, 2019

problem

can't get it run in ubuntu server, error occurs(but in my local mac it's ok):

$  docker run -it -p 127.0.0.1:8443:8443 -v "${PWD}:/home/coder/project" codercom/code-server --allow-http --no-auth
Unable to find image 'codercom/code-server:latest' locally
latest: Pulling from codercom/code-server
6abc03819f3e: Pull complete
05731e63f211: Pull complete
0bd67c50d6be: Pull complete
42645f7afa6f: Pull complete
353bd2a3bccd: Pull complete
898e646af7f6: Pull complete
5c5dc0bf677e: Pull complete
ada54e852158: Pull complete
Digest: sha256:281d40d92634057c2bb30edfe33a91517f865b4b5e0edd95ec3f81aba10ddf36
Status: Downloaded newer image for codercom/code-server:latest
docker: Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "chdir to cwd (\"/home/coder/project\") set in config.json failed: permission denied": unknown.
bug

Most helpful comment

I got the same error from my digital ocean server

UPDATE: Fixed by manually create the folders /home/coder/project

All 8 comments

I got the same error from my digital ocean server

UPDATE: Fixed by manually create the folders /home/coder/project

You tried to bind mount of a directory you do not own? we had a discussion about this on #679 but it seems they're still having a debate about the permissions inside the container (which should be irrelevant)

+1

As a temporary workaround, try running chinodesuuu/coder:ubuntu and volume mount to your PWD.


$ docker run  -p 9000:9000 -v ${PWD}:/home/coder/projects chinodesuuu/coder:ubuntu

Not working for me. I tried both options. @sr229 I also tried yours but I get 404 when I check my domain.tld:9000 but at least the service seems to be running:

....
[root@t~]# docker run  -p 9000:9000 -v ${PWD}:/home/coder/projects chinodesuuu/coder:ubuntu
Unable to find image 'chinodesuuu/coder:ubuntu' locally
ubuntu: Pulling from chinodesuuu/coder
5667fdb72017: Already exists
d83811f270d5: Already exists
ee671aafb583: Already exists
7fc152dfb3a6: Already exists
6cea2308580d: Pull complete
7943ec747a32: Pull complete
3d94d188e0e8: Pull complete
Digest: sha256:415c647b59dc8ad91f51fa63e7c9b9142db3aee2412a6884c4f7e52bb504007b
Status: Downloaded newer image for chinodesuuu/coder:ubuntu
WARNING: IPv4 forwarding is disabled. Networking will not work.
(node:7) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
INFO  code-server v1.1156-vsc1.33.1
INFO  Additional documentation: http://github.com/cdr/code-server
INFO  Initializing {"data-dir":"/home/coder/.local/share/code-server","extensions-dir":"/home/coder/.local/share/code-server/extensions","working-dir":"/home/coder/projects","log-dir":"/home/coder/.cache/code-server/logs/20191009192512925"}
INFO  Starting shared process [1/5]...
INFO  Starting webserver... {"host":"0.0.0.0","port":"9000"}
WARN  No certificate specified. This could be insecure.
WARN  Documentation on securing your setup: https://github.com/cdr/code-server/blob/master/doc/security/ssl.md
WARN
WARN  Launched without authentication.
INFO
INFO  Started (click the link below to open):
INFO  http://localhost:9000/
INFO
WARN  stderr {"data":"(node:20) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.\n"}
INFO  Connected to shared process

I also don't know why there is a permission issue, I am running this as root

In my case an un-ncecessarily pasted cmd: npm start in docker-compose.ym was the cause :)

This is more of a misconfiguration so I'll close this off now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

infogulch picture infogulch  路  3Comments

pchecinski picture pchecinski  路  3Comments

balazssoltesz picture balazssoltesz  路  3Comments

oonqt picture oonqt  路  3Comments

rcarmo picture rcarmo  路  3Comments