-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker-outside-of-docker does not work when running docker as a non-root user. #1005
Comments
@RaphaelMelanconAtBentley When you say non-root user, are you talking about the dev container user or the Docker installed on your host machine? |
The host docker is running as root, with a docker group to allow my host's user to use docker without sudo, as per Docker's documentation. In the devcontainer, I am also using a non-root user, without sudo access. From what I could find out yesterday, the GID of the host's docker group is different from the one created by the feature... |
I might also be running into this problem. I have this feature on a dev container built on top of a custom Docker image that uses a non-root user and access to /var/run/docker.sock is denied. The |
I can confirm. This is also not working for me and it seems to be because of the Dockerfile: FROM my_target_image
ARG dockerGid
USER root
RUN addgroup --gid $dockerGid docker \
&& usermod -aG docker local_user
# Reset user back to original non-root user from my_target_image
USER local_user devcontainer.json: {
"build": {
"dockerfile": "Dockerfile",
"args": { "dockerGid": "998" } // Have to manually populate the GID of my host's docker group
},
"features": {
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {}
}
} |
The feature attempts to mount
/var/run/docker.sock
, but when running docker as a non-root user as show in the docs, this is the wrong path to the socket...The text was updated successfully, but these errors were encountered: