I would like to know why --group-add docker in the following doesn't work.But I have another priority image that it does work.
docker run \
--rm \
-it \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /etc/docker/daemon.json:/etc/docker/daemon.json \
-v /etc/shadow:/etc/shadow \
-v /etc/passwd:/etc/passwd \
-v /etc/sudoers:/etc/sudoers \
-v /etc/group:/etc/group \
-u $(id -u):$(id -g) \
--group-add docker \
docker/compose:debian-1.27.4 \
bash
it errors out
docker: Error response from daemon: Unable to find group docker.
I have the same issue with other images like ubuntu, hello-world and so on. What is needed in the image to be able to add docker group?
My system:
- Ubuntu 18.04
- docker 19.03.13
I know I have the docker group in the host. I can see it in the output of groups.