Skip to content

Commit

Permalink
log docker host
Browse files Browse the repository at this point in the history
  • Loading branch information
nadim-az committed Feb 6, 2025
1 parent d8cd974 commit e6bce25
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/provider/clients/docker_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ func NewDockerClient(host string, dialFunc func(ctx context.Context, network, ad
if dialFunc != nil {
opts = append(opts, dockerclient.WithDialContext(dialFunc))
}
logger, _ := zap.NewProduction()
logger.Debug("HOST DEBUG", zap.String("host", host))

if host != "" {
logger.Debug("docker client using custom host", zap.String("host", host))
host = fmt.Sprintf("tcp://%s:2375", host)
os.Setenv("DOCKER_HOST", fmt.Sprintf("tcp://%s:2375", host))
logger.Info("docker_host: " + os.Getenv("DOCKER_HOST"))
opts = append(opts, dockerclient.WithHost(host))
opts = append(opts, dockerclient.WithVersion("1.45"))
}
Expand Down

0 comments on commit e6bce25

Please sign in to comment.