Akihiro Suda 33a3680e08 Merge pull request #42738 from thaJeztah/client_networkinspect_test 3 年之前
..
testdata 7c36a1af03 Move engine-api client package 9 年之前
README.md c8ff5ecc09 Remove use of deprecated client.NewEnvClient() 6 年之前
build_cancel.go 8128a9a478 Fix grammar in client function comments 4 年之前
build_prune.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
checkpoint_create.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
checkpoint_create_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
checkpoint_delete.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
checkpoint_delete_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
checkpoint_list.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
checkpoint_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
client.go a6dd341ca2 client: remove deprecated SetCustomHTTPHeaders(), CustomHTTPHeaders() 4 年之前
client_deprecated.go 69d9ff3455 Move deprecated client constructors to a separate file 6 年之前
client_mock_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
client_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
client_unix.go 686be57d0a Update to Go 1.17.0, and gofmt with Go 1.17 3 年之前
client_windows.go 772edd020c Introduce NewClientWithOpts func to build custom client easily 7 年之前
config_create.go 8128a9a478 Fix grammar in client function comments 4 年之前
config_create_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
config_inspect.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
config_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
config_list.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
config_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
config_remove.go 8128a9a478 Fix grammar in client function comments 4 年之前
config_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
config_update.go 8128a9a478 Fix grammar in client function comments 4 年之前
config_update_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_attach.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
container_commit.go 8128a9a478 Fix grammar in client function comments 4 年之前
container_commit_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_copy.go 8128a9a478 Fix grammar in client function comments 4 年之前
container_copy_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_create.go 5f0703c549 client: remove containerd "platform" dependency 4 年之前
container_create_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_diff.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
container_diff_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_exec.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
container_exec_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_export.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
container_export_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_inspect.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_kill.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
container_kill_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_list.go 5f47cef514 fix nolint comments for SA1019: filters.ToParamWithVersion is deprecated 5 年之前
container_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_logs.go 48cfe3f087 Improve GetTimestamp parsing 7 年之前
container_logs_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_pause.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
container_pause_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_prune.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
container_prune_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_remove.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
container_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_rename.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
container_rename_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_resize.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
container_resize_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_restart.go 8128a9a478 Fix grammar in client function comments 4 年之前
container_restart_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_start.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
container_start_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_stats.go ce1ceeb257 Add stats options to not prime the stats 5 年之前
container_stats_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_stop.go b85799b63f Merge pull request #36874 from kolyshkin/stop-timeout 7 年之前
container_stop_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_top.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
container_top_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_unpause.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
container_unpause_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_update.go 8128a9a478 Fix grammar in client function comments 4 年之前
container_update_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
container_wait.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
container_wait_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
disk_usage.go 47ad2f3dd6 API,daemon: support `type` URL parameter to /system/df 4 年之前
disk_usage_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
distribution_inspect.go 8128a9a478 Fix grammar in client function comments 4 年之前
distribution_inspect_test.go 9f0b3f5609 bump gotest.tools v3.0.1 for compatibility with Go 1.14 5 年之前
errors.go 07d60bc257 Replace errors.Cause() with errors.Is() / errors.As() 5 年之前
events.go 5f47cef514 fix nolint comments for SA1019: filters.ToParamWithVersion is deprecated 5 年之前
events_test.go 0cd1bd42b4 Merge pull request #42770 from thaJeztah/eventtype_enums 3 年之前
hijack.go 5f47cef514 fix nolint comments for SA1019: filters.ToParamWithVersion is deprecated 5 年之前
hijack_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_build.go 8128a9a478 Fix grammar in client function comments 4 年之前
image_build_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_create.go 8128a9a478 Fix grammar in client function comments 4 年之前
image_create_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_history.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
image_history_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_import.go 8128a9a478 Fix grammar in client function comments 4 年之前
image_import_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_inspect.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_list.go 5f47cef514 fix nolint comments for SA1019: filters.ToParamWithVersion is deprecated 5 年之前
image_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_load.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
image_load_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_prune.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
image_prune_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_pull.go 0cafc84fb2 Use errdefs for handling errors in client 6 年之前
image_pull_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_push.go d135dc242e client.ImagePush(): default to ":latest" instead of "all tags" 5 年之前
image_push_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_remove.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
image_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_save.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
image_save_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_search.go 8128a9a478 Fix grammar in client function comments 4 年之前
image_search_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
image_tag.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
image_tag_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
info.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
info_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
interface.go 47ad2f3dd6 API,daemon: support `type` URL parameter to /system/df 4 年之前
interface_experimental.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
interface_stable.go 4f0d95fa6e Add canonical import comment 7 年之前
login.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
network_connect.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
network_connect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
network_create.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
network_create_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
network_disconnect.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
network_disconnect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
network_inspect.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
network_inspect_test.go 4045c4ceaf client: use subtests for TestNetworkInspect 3 年之前
network_list.go 5f47cef514 fix nolint comments for SA1019: filters.ToParamWithVersion is deprecated 5 年之前
network_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
network_prune.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
network_prune_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
network_remove.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
network_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
node_inspect.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
node_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
node_list.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
node_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
node_remove.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
node_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
node_update.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
node_update_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
options.go 28d7dba41d Merge pull request #39032 from thaJeztah/improve_version_negotiation 6 年之前
options_test.go 9f0b3f5609 bump gotest.tools v3.0.1 for compatibility with Go 1.14 5 年之前
ping.go 4d249ae1f3 remove extra space in code comment in ping.go 5 年之前
ping_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
plugin_create.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
plugin_disable.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
plugin_disable_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
plugin_enable.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
plugin_enable_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
plugin_inspect.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
plugin_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
plugin_install.go 0cafc84fb2 Use errdefs for handling errors in client 6 年之前
plugin_list.go 5f47cef514 fix nolint comments for SA1019: filters.ToParamWithVersion is deprecated 5 年之前
plugin_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
plugin_push.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
plugin_push_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
plugin_remove.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
plugin_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
plugin_set.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
plugin_set_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
plugin_upgrade.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
request.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
request_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
secret_create.go 8128a9a478 Fix grammar in client function comments 4 年之前
secret_create_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
secret_inspect.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
secret_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
secret_list.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
secret_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
secret_remove.go 8128a9a478 Fix grammar in client function comments 4 年之前
secret_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
secret_update.go 8128a9a478 Fix grammar in client function comments 4 年之前
secret_update_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
service_create.go 8128a9a478 Fix grammar in client function comments 4 年之前
service_create_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
service_inspect.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
service_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
service_list.go f36042d259 Add support for sending down service Running and Desired task counts 5 年之前
service_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
service_logs.go 48cfe3f087 Improve GetTimestamp parsing 7 年之前
service_logs_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
service_remove.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
service_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
service_update.go ed096538e8 extract logic for resolving image/plugin digest and platform 5 年之前
service_update_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
swarm_get_unlock_key.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
swarm_get_unlock_key_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
swarm_init.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
swarm_init_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
swarm_inspect.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
swarm_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
swarm_join.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
swarm_join_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
swarm_leave.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
swarm_leave_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
swarm_unlock.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
swarm_unlock_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
swarm_update.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
swarm_update_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
task_inspect.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
task_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
task_list.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
task_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
task_logs.go 7d62e40f7e Switch from x/net/context -> context 7 年之前
transport.go 4f0d95fa6e Add canonical import comment 7 年之前
utils.go 4f0d95fa6e Add canonical import comment 7 年之前
version.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
volume_create.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
volume_create_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
volume_inspect.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
volume_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
volume_list.go 5f47cef514 fix nolint comments for SA1019: filters.ToParamWithVersion is deprecated 5 年之前
volume_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前
volume_prune.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
volume_remove.go 9c846b2fcc Client: always call ensureReaderClosed 6 年之前
volume_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 年之前

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