full diff:46229ca1d8...v20.10.7 This is the equivalent of49f6071532on master, but the vendored version in 20.10 was different. Last updates where: - Master:7bef248765- diff: https://github.com/moby/moby/compare/v20.10.1...d5209b29b9777e0b9713d87847a5dc8ce9d93da6 -d5209b29b9is a commit from moby "master" - 20.10:5941f4104a- diff: https://github.com/docker/docker/compare/v20.10.1...46229ca1d815cfd4b50eb377ac75ad8300e13a85 -46229ca1d8is a commit from moby "20.10" The 20.10 version mentions it was cherry-picked from7bef248765, but that's not the case; there's another diff in the 20.10 branch that was not in master:d5209b29b9...46229ca1d815cfd4b50eb377ac75ad8300e13a85 raw diffd5209b29b9..46229ca1d815cfd4b50eb377ac75ad8300e13a85 Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
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)
}
}