Files
k3s/vendor/github.com/docker/docker/client
Brad Davidson e8381db778 Update Kubernetes to v1.21.0
* Update Kubernetes to v1.21.0
* Update to golang v1.16.2
* Update dependent modules to track with upstream
* Switch to upstream flannel
* Track changes to upstream cloud-controller-manager and FeatureGates

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
2021-04-14 14:51:42 -07:00
..
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2021-04-14 14:51:42 -07:00
2019-01-11 21:58:27 -07:00
2021-04-14 14:51:42 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2021-04-14 14:51:42 -07:00
2020-12-08 22:51:34 -08:00
2020-12-08 22:51:34 -08:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2020-12-08 22:51:34 -08:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2021-04-14 14:51:42 -07:00
2020-12-08 22:51:34 -08:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2020-12-08 22:51:34 -08:00
2019-01-11 21:58:27 -07:00
2020-12-08 22:51:34 -08:00
2020-12-08 22:51:34 -08:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2020-12-08 22:51:34 -08:00
2021-04-14 14:51:42 -07:00
2019-01-11 21:58:27 -07:00
2021-04-14 14:51:42 -07:00
2019-01-11 21:58:27 -07:00
2021-04-14 14:51:42 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2020-12-08 22:51:34 -08:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2019-01-11 21:58:27 -07:00
2020-12-08 22:51:34 -08:00

Go client for the Docker Engine API

The docker command uses this package to communicate with the daemon. It can also be used by your own Go applications to do anything the command-line interface does  running containers, pulling images, managing swarms, etc.

For example, to list running containers (the equivalent of docker ps):

package main

import (
	"context"
	"fmt"

	"github.com/docker/docker/api/types"
	"github.com/docker/docker/client"
)

func main() {
	cli, err := client.NewClientWithOpts(client.FromEnv)
	if err != nil {
		panic(err)
	}

	containers, err := cli.ContainerList(context.Background(), types.ContainerListOptions{})
	if err != nil {
		panic(err)
	}

	for _, container := range containers {
		fmt.Printf("%s %s\n", container.ID[:10], container.Image)
	}
}

Full documentation is available on GoDoc.