19 lines
376 B
Go
19 lines
376 B
Go
|
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
|
||
|
}
|