func TestPs(t *testing.T) { status := docker.Ps() t.Log("$ docker ps -a") for i := 0; i < len(status); i++ { t.Logf("%#v", status[i]) } }
func GetStatus() []PsOutput { var status []PsOutput status = make([]PsOutput, 0) ps := docker.Ps() for i := 0; i < len(ps); i++ { p := ps[i] cid := p.ContainerId status = append(status, PsOutput{ Running: docker.InspectRunning(cid), Pid: docker.InspectPid(cid), ContainerId: cid, Ip: docker.InspectIp(cid), Image: p.Image, Command: p.Command, Ports: p.Ports, Status: p.Status, }) } return status }
func TestInit(t *testing.T) { t.Logf("%s", docker.Ps()) t.Logf("%s", busybox) }