move dockerhost into global config

This commit is contained in:
Bradley Cicenas
2017-01-04 17:50:49 +00:00
parent 062c4298f2
commit a708951c80
2 changed files with 16 additions and 9 deletions

View File

@@ -1,13 +1,23 @@
package main
import (
"os"
)
type Config struct {
sortField string
dockerHost string
sortField string
}
var DefaultConfig = NewDefaultConfig()
func NewDefaultConfig() Config {
docker := os.Getenv("DOCKER_HOST")
if docker == "" {
docker = "unix:///var/run/docker.sock"
}
return Config{
sortField: "id",
dockerHost: docker,
sortField: "id",
}
}