about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorEmile <hanemile@protonmail.com>2019-10-08 00:13:56 +0200
committerEmile <hanemile@protonmail.com>2019-10-08 00:13:56 +0200
commit1a4167dc1e10e4d4d8167970948588b878e1de4d (patch)
tree163dae614093aefd8ff44d81b212e0a677b3a57c /src
parent4746698c0674c1ae9f25b221f239d390e5eb68bc (diff)
getting the network id and building the network config
Diffstat (limited to 'src')
-rw-r--r--src/docker.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/docker.go b/src/docker.go
index 12f3b54..51e1d81 100644
--- a/src/docker.go
+++ b/src/docker.go
@@ -79,7 +79,16 @@ func spawnCompanion(username string, accesscode string) {
 		},
 	}
 
-	log.Println("Starting the container")
+	circusNetworkID, err := getCircusNetworkID(dockerCtx, dockerCLI)
+	NetworkingConfig := &network.NetworkingConfig{
+		EndpointsConfig: map[string]*network.EndpointSettings{
+			"circus": {
+				NetworkID: circusNetworkID,
+			},
+		},
+	}
+
+	log.Println("Creating the container")
 
 	// create the docker container
 	resp, err := dockerCLI.ContainerCreate(dockerCtx, Config, HostConfig, nil, "")