about summary refs log tree commit diff
path: root/src/docker.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/docker.go')
-rw-r--r--src/docker.go12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/docker.go b/src/docker.go
index 846a77e..71075c6 100644
--- a/src/docker.go
+++ b/src/docker.go
@@ -6,6 +6,7 @@ import (
 	"os"
 
 	"github.com/docker/docker/api/types/container"
+	"github.com/docker/docker/api/types/mount"
 	"github.com/docker/docker/api/types/network"
 	"github.com/docker/docker/client"
 )
@@ -33,14 +34,13 @@ func setupDockerCLI() (err error) {
 	return err
 }
 
-func spawnCompanion(username string) string {
+func spawnCompanion(username string, accesscode string) string {
 	log.Println("Spwaning a new companion container")
 	// setup the context and the docker cli connection
 	setupContext()
 	setupDockerCLI()
 
 	Config := &container.Config{
-		// docker socket
 		// companion seed
 		Image: "circus-companion:latest",
 		//
@@ -54,6 +54,14 @@ func spawnCompanion(username string) string {
 
 	HostConfig := &container.HostConfig{
 		// ports (nat.PortMap)
+		// docker socket
+		Mounts: []mount.Mount{
+			{
+				Type:   mount.TypeBind,
+				Source: "/var/run/docker.sock",
+				Target: "/var/run/docker.sock",
+			},
+		},
 	}
 
 	NetworkingConfig := &network.NetworkingConfig{