DockerCLI/client
Daniel Nephin 08af0f28c5 Add gocycle lint
Whitelist some existing offenders, and use a high limit for now.
This limit should decrese over time.

Signed-off-by: Daniel Nephin <dnephin@docker.com>
2017-05-02 17:57:46 -04:00
..
testdata Import docker/docker/client 2017-04-17 17:41:20 -04:00
README.md Update imports. 2017-04-17 18:07:56 -04:00
checkpoint_create.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
checkpoint_create_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
checkpoint_delete.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
checkpoint_delete_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
checkpoint_list.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
checkpoint_list_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
client.go Update imports. 2017-04-17 18:07:56 -04:00
client_mock_test.go Add deadcode linter. 2017-05-02 17:57:46 -04:00
client_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
client_unix.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
client_windows.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_attach.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_commit.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_commit_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_copy.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_copy_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_create.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_create_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_diff.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_diff_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_exec.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_exec_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_export.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_export_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_inspect.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_inspect_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_kill.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_kill_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_list.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_list_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_logs.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_logs_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_pause.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_pause_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_prune.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_prune_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_remove.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_remove_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_rename.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_rename_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_resize.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_resize_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_restart.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_restart_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_start.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_start_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_stats.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_stats_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_stop.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_stop_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_top.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_top_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_unpause.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_unpause_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_update.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_update_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_wait.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
container_wait_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
disk_usage.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
errors.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
events.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
events_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
hijack.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_build.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_build_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_create.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_create_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_history.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_history_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_import.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_import_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_inspect.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_inspect_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_list.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_list_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_load.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_load_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_prune.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_prune_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_pull.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_pull_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_push.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_push_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_remove.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_remove_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_save.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_save_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_search.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_search_test.go Add goimports to linting 2017-05-02 17:57:46 -04:00
image_tag.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
image_tag_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
info.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
info_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
interface.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
interface_experimental.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
interface_stable.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
login.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_connect.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_connect_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_create.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_create_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_disconnect.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_disconnect_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_inspect.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_inspect_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_list.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_list_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_prune.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_prune_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_remove.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
network_remove_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
node_inspect.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
node_inspect_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
node_list.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
node_list_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
node_remove.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
node_remove_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
node_update.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
node_update_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
ping.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_create.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_disable.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_disable_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_enable.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_enable_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_inspect.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_inspect_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_install.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_list.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_list_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_push.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_push_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_remove.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_remove_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_set.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_set_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
plugin_upgrade.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
request.go Add gocycle lint 2017-05-02 17:57:46 -04:00
request_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
secret_create.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
secret_create_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
secret_inspect.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
secret_inspect_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
secret_list.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
secret_list_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
secret_remove.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
secret_remove_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
secret_update.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
secret_update_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
service_create.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
service_create_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
service_inspect.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
service_inspect_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
service_list.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
service_list_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
service_logs.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
service_logs_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
service_remove.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
service_remove_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
service_update.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
service_update_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
swarm_get_unlock_key.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
swarm_init.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
swarm_init_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
swarm_inspect.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
swarm_inspect_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
swarm_join.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
swarm_join_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
swarm_leave.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
swarm_leave_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
swarm_unlock.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
swarm_update.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
swarm_update_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
task_inspect.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
task_inspect_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
task_list.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
task_list_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
task_logs.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
transport.go Add deadcode linter. 2017-05-02 17:57:46 -04:00
utils.go Add goimports to linting 2017-05-02 17:57:46 -04:00
version.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
volume_create.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
volume_create_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
volume_inspect.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
volume_inspect_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
volume_list.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
volume_list_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
volume_prune.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
volume_remove.go Import docker/docker/client 2017-04-17 17:41:20 -04:00
volume_remove_test.go Import docker/docker/client 2017-04-17 17:41:20 -04:00

README.md

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/cli/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.