From 82e12021b3d40d59ec3b8bd14952fb3ccda2faaf Mon Sep 17 00:00:00 2001 From: Ivan Krutov Date: Mon, 5 Jun 2017 16:08:57 +0300 Subject: [PATCH] Adding docker socket when necessary (fixes #13) --- selenoid/docker.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/selenoid/docker.go b/selenoid/docker.go index 23e0648..2dd2edd 100644 --- a/selenoid/docker.go +++ b/selenoid/docker.go @@ -349,6 +349,10 @@ func (c *DockerConfigurator) Start() error { portBindings := nat.PortMap{} portBindings[port] = []nat.PortBinding{{HostIP: "0.0.0.0", HostPort: portString}} volumes := []string{fmt.Sprintf("%s:/etc/selenoid:ro", c.ConfigDir)} + const dockerSocket = "/var/run/docker.sock" + if fileExists(dockerSocket) { + volumes = append(volumes, fmt.Sprintf("%s:%s", dockerSocket, dockerSocket)) + } ctx := context.Background() ctr, err := c.docker.ContainerCreate(ctx, &container.Config{