nvwa/service/docker_container.go

19 lines
376 B
Go
Raw Normal View History

2018-08-29 17:58:41 +00:00
package service
import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
)
func (d *docker) ContainerList() []types.Container {
var (
ctx = d.context
options = types.ContainerListOptions{Filters: filters.NewArgs()}
)
containers, err := d.client.ContainerList(ctx, options)
if err != nil {
panic(err)
}
return containers
}