Exemplo n.º 1
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
}
Exemplo n.º 2
0
func TestIp(t *testing.T) {
	t.Log(docker.InspectIp(busybox))
}