about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/docker.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/docker.go b/src/docker.go
index 1dda5b2..7dfe584 100644
--- a/src/docker.go
+++ b/src/docker.go
@@ -120,6 +120,16 @@ func spawnCompanion(username string, accesscode string) {
 	connectContainerToNetwork(containerID, circusNetworkID)
 
 	log.Println("Container added to the circus network")
+
+	// Get IP Address of that container
+	inspectJSON, err := dockerCLI.ContainerInspect(dockerCtx, containerID)
+	if err != nil {
+		log.Println("inspectJsonErr: ", err)
+	}
+
+	fmt.Println("---")
+	fmt.Printf("%#v", inspectJSON.NetworkSettings.Networks)
+	fmt.Printf("companion IP: %#v", inspectJSON.NetworkSettings.Networks["circus"].IPAddress)
 }
 
 func generateSessionSalt() string {