update container, add collect methods and main entrypoint

This commit is contained in:
Bradley Cicenas
2016-12-22 22:04:21 +00:00
parent 1c285c9e92
commit 83a5b0e1f0
3 changed files with 103 additions and 43 deletions

30
main.go Normal file
View File

@@ -0,0 +1,30 @@
package main
import (
"fmt"
"os"
"github.com/fsouza/go-dockerclient"
)
func main() {
if len(os.Args) < 2 {
fmt.Println("no container provided")
os.Exit(1)
}
client, err := docker.NewClient("tcp://127.0.0.1:4243")
if err != nil {
panic(err)
}
g := &Grid{make(map[string]*Container)}
g.AddContainer(os.Args[1])
for _, c := range g.containers {
c.Collect(client)
}
Display(g)
}