Closed rhaschke closed 2 years ago
Hmmm... When you mount the Docker socket inside the container, you're not running Docker-in-Docker. You're talking to the Docker daemon on the host machine. So this is working as expected.
Running Docker-in-Docker is more tricky. Try something like: https://github.com/nestybox/sysbox/blob/master/docs/user-guide/dind.md
Thanks for pointing out the difference between DinD and DooD. I will resort to sysbox then.
I am trying to run another docker command within an already running docker container. To this end, of course, I forwarded the socket via option
-v /var/run/docker.sock:/var/run/docker.sock
. This works fine. However, trying to bind-mount volumes within the inner docker container (referring to folders in the outer container) fails: the mounted volumes refer to the host's volume, not the ones of the external docker container as expected.Steps to reproduce the behavior
start outer docker container:
docker run --rm -it -v /var/run/docker.sock:/var/run/docker.sock ubuntu:focal
start inner docker container:
Output of
docker version
: