Coder OSS gives docker.sock connect permission denied
Hello, I'm running Coder (through Docker Compose) on a EC2 instance. Some of my previous posts include issues on Kuberntes so now I decided to test Coder OSS on a EC2. Upon the creation of docker template or docker-code-server template, Coder raises "Error pinging Docker server: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/_ping": dial unix /var/run/docker.sock: connect: permission denied". I added my user to the docker group already end relogged. Is this issue known? Thank you guys.
11 Replies
UPDATE: i fixed the problem doing sudo chmod 666 /var/run/docker.sock I am not a huge fan of this approach but it works for now
otherwise mount it to /home/coder
This a good advice, I'll use this post to share another problem. Let me know if you prefer I open a new post.
The scenario is always the same: coder through docker-compose on a ec2 accessible through elastic ip. Is there a possible explanation of why I cannot see the icons of SSH, Terminal and Coder server?
my guess is the coder agent can't reach the server in some way
potentially an access_url that is not accessible from within the container
you talk about the container of the workspace?
which one is involved in this case? CODER_ADDRESS or CODER_ACCESS_URL
the container of the workspace
so the workspace
CODER_ACCESS_URL
Yes, I can confirm that the workspace pod cannot ping the elastic ip
yup, what's your CODER_ACCESS_URL?
an ip v4 address provided by AWS (elastic ip) bounded to a EC2 instance
I can confirm that through that Ip i can reach the coder console
i don't really know tbf, just try finding out why the CT can't communicate with it
or actually, you can keep it mounted where it was and run the container as user
coder:998
, where 998 is the gid of the docker group
or you could use a docker socket proxy but I was too lazy to do thatSeems to work now, thx!