Skip to content

Commit

Permalink
Change to use containip when no docker mode
Browse files Browse the repository at this point in the history
  • Loading branch information
junbeomlee committed Oct 31, 2018
1 parent cecbf5f commit 88d0206
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
11 changes: 8 additions & 3 deletions container/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package container

import (
"context"

"docker.io/go-docker/api/types"

"errors"
Expand Down Expand Up @@ -65,9 +66,13 @@ func Create(config tesseract.ContainerConfig) (DockerContainer, error) {
return DockerContainer{}, err
}

ipAddress := retrieveNetworkIpAddress(config.Network.Name, containerInfo)

client, err := createClient(ipAddress, config.Port)
var client *rpc.ClientStream
if config.Network == nil {
client, err = createClient(config.ContainerIp, config.Port)
} else {
ipAddress := retrieveNetworkIpAddress(config.Network.Name, containerInfo)
client, err = createClient(ipAddress, config.Port)
}

if err != nil {
iLogger.Errorf(nil, "[Tesseract] closing container %s", res.ID)
Expand Down
1 change: 1 addition & 0 deletions docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func CreateContainer(config tesseract.ContainerConfig) (container.ContainerCreat
networkName := ""
portBinding := nat.PortMap{}
exposedPort := nat.PortSet{}

var networkConfig *network.NetworkingConfig

if config.Network != nil {
Expand Down

0 comments on commit 88d0206

Please sign in to comment.