add support for TLS via NewClientFromEnv(), remove dockerHost config param

This commit is contained in:
Bradley Cicenas 2017-03-09 22:57:12 +00:00
parent 03d4869361
commit 96b01eb3b9
2 changed files with 1 additions and 7 deletions

View File

@ -2,11 +2,6 @@ package config
// defaults // defaults
var params = []*Param{ var params = []*Param{
&Param{
Key: "dockerHost",
Val: getEnv("DOCKER_HOST", "unix:///var/run/docker.sock"),
Label: "Docker API URL",
},
&Param{ &Param{
Key: "filterStr", Key: "filterStr",
Val: "", Val: "",

View File

@ -4,7 +4,6 @@ import (
"sort" "sort"
"strings" "strings"
"github.com/bcicen/ctop/config"
"github.com/bcicen/ctop/metrics" "github.com/bcicen/ctop/metrics"
"github.com/fsouza/go-dockerclient" "github.com/fsouza/go-dockerclient"
) )
@ -22,7 +21,7 @@ type DockerContainerSource struct {
func NewDockerContainerSource() *DockerContainerSource { func NewDockerContainerSource() *DockerContainerSource {
// init docker client // init docker client
client, err := docker.NewClient(config.GetVal("dockerHost")) client, err := docker.NewClientFromEnv()
if err != nil { if err != nil {
panic(err) panic(err)
} }