mirror of
https://github.com/kolaente/docker-db-backup.git
synced 2026-03-24 21:43:48 +01:00
Also updates all affected new types. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: kolaente <k@knt.li>
17 lines
402 B
Go
17 lines
402 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/docker/docker/api/types/container"
|
|
"github.com/docker/docker/client"
|
|
)
|
|
|
|
func getClient() (*client.Client, error) {
|
|
return client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
|
|
}
|
|
|
|
func getContainers(c *client.Client) ([]container.Summary, error) {
|
|
return c.ContainerList(context.Background(), container.ListOptions{All: true})
|
|
}
|