question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to start 'cdr/code-server' in Docker container: “error EACCES: permission denied, mkdir '/home/coder/.config/code-server'”

See original GitHub issue

Here’s my script:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
sudo usermod -aG docker $USER

Then I disconnect from ssh, connect back, and run this command:

docker run -it --name code-server -p 127.0.0.1:8080:8080 -v "$HOME/.config:/home/coder/.config:rw" -v "$PWD:/home/coder/project:rw" -u "$(id -u):$(id -g)" -e "DOCKER_USER=$USER" codercom/code-server:latest

The error I get is error EACCES: permission denied, mkdir '/home/coder/.config/code-server'.

This is on a brand new EC2 instance. Any ideas? I’ve been banging my head on this and I don’t know how to debug further. I’ve tried removing the -e and -u options from the command but those don’t seem to have any effect, both with and without running docker with sudo but to no avail. Thank you!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yonixwcommented, Aug 22, 2022

What worked for me is (with inside docker support with sudo):

  1. to create a folder, cd into it,
  2. prepare mount folder by mkdir -p home/.config
  3. Runnit this command:
docker run
  -it --name code-server 
  -p 8080:8080 
  -v /var/run/docker.sock:/var/run/docker.sock 
  -v "$(pwd)/home:/home/coder/" 
  -u "$(id -u):$(id -g)" 
  -e "DOCKER_USER=$USER" 
codercom/code-server:latest
1reaction
jsjoeiocommented, Aug 2, 2021

@brootware please open a GitHub Discussion or a bug report if you’re experiencing issues!

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found