0

TL;DR: How do I create or link a Docker socket at /var/run/docker.sock at my host for a Docker Machine instance?


On my Mac, I installed Docker and Docker Machine using Homebrew:

brew install docker docker-machine

I also installed docker-machine-driver-vmware to create a Docker Machine instance based on my hypervisor:

brew install docker-machine-driver-vmware
docker-machine create --driver vmware default

My problem is that I have an application that relies on the Docker socket to create containers, but I cannot find the Docker socket anywhere in my system.

How do I find the Docker socket, and how can I change it or link it to /var/run/docker.sock?

Marwi
  • 153
  • 2
  • 11
  • If you're using Docker Machine, there's not a Unix socket on the host; you need to make a TCP connection to the VM. See for example [Can't connect to docker from docker-compose](https://stackoverflow.com/questions/29101043/cant-connect-to-docker-from-docker-compose). The standard Docker SDK understands the `$DOCKER_HOST` environment variable and other settings to make this connection. (The Docker Desktop application could be simpler to use, if you don't have other reasons for specifically wanting this VM setup.) – David Maze Oct 29 '20 at 10:50
  • @DavidMaze using `eval $(docker-machine env default)` (which configures `DOCKER_HOST` along with other environment variables for instance `default`) works well for cases that you want to interact with Docker from the shell instead of the socket, which is what most applications use to interact with Docker. – Marwi Oct 29 '20 at 12:09
  • I made my question more general to appeal to more people. – Marwi Oct 30 '20 at 14:32

0 Answers0