Access Docker socket within container

I figured it out. You can simply pass the the socket file through the volume argument

docker run -v /var/run/docker.sock:/container/path/docker.sock

As @zarathustra points out, this may not be the greatest idea however. See: https://www.lvh.io/posts/dont-expose-the-docker-socket-not-even-to-a-container/

Leave a Comment