mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
get dockerhost from environment
This commit is contained in:
parent
ca9ea17a81
commit
a15d4c4dfe
7
main.go
7
main.go
@ -13,7 +13,12 @@ func main() {
|
|||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
client, err := docker.NewClient("tcp://127.0.0.1:4243")
|
dockerhost := os.Getenv("DOCKER_HOST")
|
||||||
|
if dockerhost == "" {
|
||||||
|
dockerhost = "unix:///var/run/docker.sock"
|
||||||
|
}
|
||||||
|
|
||||||
|
client, err := docker.NewClient(dockerhost)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user