Docker in Docker permissions error

0 votes

I have a docker in docker setup for CI. Essentially, the machine has a jenkins CI server on it that uses the same machines docker socket to create nodes for CI.

This was working great until I recently updated docker. I've identified the issue, but I can't seem to figure out the right magic to get it working.

host $ docker exec -it myjenkins bash
jenkins@container $ 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.26/containers/json: dial unix /var/run/docker.sock: connect: permission denied
host $ docker exec -it -u root -it myjenkins bash
root@container $ docker ps 
... docker ps from host container yay! ...

So here's what I surmise. I have access to the host docker socket from within the container, but I can't seem to give permission to the jenkins user.

I've added the docker group, and also added the jenkins user to the docker group. But I still get the same error. I've restarted a whack of times so, I'm kind of at a loss for what to do next.

Is there a way to force permissions for a user on a particular socket?

Jul 30, 2018 in Docker by Hannah
• 18,570 points
606 views

1 answer to this question.

0 votes

Personally, i've just had to do this :

sudo gpasswd -a $USER docker 

And it worked out

answered Jul 30, 2018 by Kalgi
• 52,360 points

Related Questions In Docker

0 votes
1 answer
0 votes
2 answers

How do I fix the “no space left on device” error in docker?

Try cleaning up: $ docker volume rm $(docker ...READ MORE

answered Aug 14, 2019 in Docker by Sirajul
• 59,230 points
12,132 views
0 votes
1 answer

Error: Cannot access server in docker container

Try to publish your port: docker run -p ...READ MORE

answered Sep 7, 2018 in Docker by Tyrion anex
• 8,700 points
842 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,090 points
2,436 views
+6 votes
4 answers

Error: Docker saying "bad file descriptor"

The solution was easy enough. Add these ...READ MORE

answered Mar 27, 2018 in Docker by DragonLord999
• 8,450 points
6,557 views
0 votes
1 answer

How to list containers in Docker

To show only running containers use the given command: docker ...READ MORE

answered Jul 20, 2018 in Docker by Kalgi
• 52,360 points
475 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP