From 1a4167dc1e10e4d4d8167970948588b878e1de4d Mon Sep 17 00:00:00 2001 From: Emile Date: Tue, 8 Oct 2019 00:13:56 +0200 Subject: getting the network id and building the network config --- src/docker.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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, "") -- cgit 1.4.1