Пример #1
0
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])
	}
}
Пример #2
0
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
}
Пример #3
0
func TestInit(t *testing.T) {
	t.Logf("%s", docker.Ps())
	t.Logf("%s", busybox)
}