Files
moby/client
Brian Goff 642e9917ff Add otel support
This uses otel standard environment variables to configure tracing in
the daemon.
It also adds support for propagating trace contexts in the client and
reading those from the API server.

See
https://opentelemetry.io/docs/specs/otel/configuration/sdk-environment-variables/
for details on otel environment variables.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
2023-09-07 18:38:19 +00:00
..
2023-09-07 18:38:19 +00:00
2023-09-07 18:38:19 +00:00
2023-05-19 20:38:51 +02:00
2023-09-07 18:38:19 +00:00
2023-07-05 23:44:17 +00:00
2022-09-28 01:58:52 +02:00
2023-09-07 18:38:19 +00:00
2022-11-30 17:08:00 +01:00
2022-07-29 23:05:15 +02:00
2023-06-29 00:25:21 +02:00
2023-09-07 18:38:19 +00:00
2018-05-20 13:07:17 +02: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)
	}
	defer cli.Close()

	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.