Files
docker-cli/components/engine/client
John Howard 35db73fa01 LCOW: API: Add platform to /images/create and /build
Signed-off-by: John Howard <jhoward@microsoft.com>

This PR has the API changes described in https://github.com/moby/moby/issues/34617.
Specifically, it adds an HTTP header "X-Requested-Platform" which is a JSON-encoded
OCI Image-spec `Platform` structure.

In addition, it renames (almost all) uses of a string variable platform (and associated)
methods/functions to os. This makes it much clearer to disambiguate with the swarm
"platform" which is really os/arch. This is a stepping stone to getting the daemon towards
fully multi-platform/arch-aware, and makes it clear when "operating system" is being
referred to rather than "platform" which is misleadingly used - sometimes in the swarm
meaning, but more often as just the operating system.
Upstream-commit: 0380fbff37922cadf294851b1546f4c212c7f364
Component: engine
2017-10-06 11:44:18 -07:00
..
2016-09-07 11:05:58 -07:00
2017-08-21 18:18:50 -04:00
2016-09-07 11:05:58 -07:00
2017-09-12 12:09:59 -04:00
2016-10-31 11:16:02 -04:00
2016-11-09 14:46:53 -08:00
2017-07-03 13:13:09 -07:00
2016-09-22 14:42:06 -04:00
2017-09-12 12:09:59 -04:00
2017-02-07 11:08:37 -08:00
2016-09-07 11:05:58 -07:00
2017-02-07 11:08:37 -08:00
2017-02-07 11:08:37 -08:00
2017-02-07 11:08:37 -08:00
2016-09-07 11:05:58 -07:00
2017-08-21 18:15:08 -04:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2016-09-07 11:05:58 -07:00
2017-06-29 12:42:14 -04:00
2017-09-11 19:53:18 -04:00
2016-11-21 13:11:40 -08:00
2016-11-21 13:11:40 -08:00
2016-10-24 15:20:01 -07:00
2016-11-22 12:49:38 +00:00
2017-09-11 19:53:18 -04:00
2017-09-08 18:23:21 -04:00
2016-11-10 13:46:02 -08:00
2016-11-10 13:46:02 -08:00
2016-12-20 22:08:07 +08:00
2016-12-20 22:08:07 +08:00
2016-12-20 22:08:07 +08:00
2016-12-20 22:08:07 +08:00
2016-12-20 22:08:07 +08:00
2017-08-21 18:18:50 -04:00
2016-09-07 11:05:58 -07: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.NewEnvClient()
	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.