3
0
mirror of https://kolaente.dev/konrad/docker-db-backup.git synced 2026-01-08 17:30:07 +01:00
Files
2021-08-18 20:09:45 +02:00

16 lines
394 B
Go

package main
import (
"context"
"github.com/docker/docker/api/types"
"github.com/docker/docker/client"
)
func getClient() (*client.Client, error) {
return client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())
}
func getContainers(c *client.Client) ([]types.Container, error) {
return c.ContainerList(context.Background(), types.ContainerListOptions{All: true})
}