coder / sail

Deprecated: Instant, pre-configured VS Code development environments.

Home Page:https://sail.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

example docker forwarding from host requires elevated permissions

teddy-codes opened this issue · comments

commented

When going through the docker example in the docs, I am unable to set the user permissions properly. I have tried RUN sudo usermod -a -G docker $(whoami), but... that failed. Not sure what I could be doing wrong. Any insight would be great.

Hi,

I get permission errors while doing even a docker ps.

I followed the instructions from https://sail.dev/docs/guides/docker-in-docker/ to install docker, btw.

I also noticed that the user user does not belong to the docker group. Not really sure what is the right procedure if you install the docker client only, like I did.

Nonetheless I tried to add the user to the docker group, from inside my .sail/Dockerfile with:

sudo groupadd docker
sudo usermod -aG docker user

as per: https://docs.docker.com/install/linux/linux-postinstall/

But still, although the user now belongs to the docker group:

user@sgo:~/sgo$ groups
user docker

still I cannot access Docker, when running the docker, getting a:

user@sgo:~/sgo$ docker ps
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.39/containers/json: dial unix /var/run/docker.sock: connect: permission denied

from the VS Code terminal.

This prevents me starting some docker-compose files that I need to run.

commented

If you do this, then you are unable to use docker on the host machine.

Edit:
Until a restart

Why is that? I have no issues using docker in the host machine.