I have packaged my server service into a Docker image. When starting the container, I want the service inside to be able to access the Docker daemon on the host.
I found a common solution like this:I have packaged my server service into a Docker image. When starting the container, I want the service inside to be able to access the Docker daemon on the host.
I found a common solution like this:
docker run -d \ --name opensandbox-server \ -p 8080:8080 \ -v /var/run/docker.sock:/var/run/docker.sock \ opensandbox-server
I want to confirm:
- Is mounting /var/run/docker.sock the only way for the containerized server to access the Docker daemon?
- If there are other secure and compliant approaches to let the container access Docker daemon without mounting /var/run/docker.sock, what are they?
In my company, mounting /var/run/docker.sock violates internal security policies, so I need an alternative solution.