Sebastiaan van Stijn 08e4e88482 daemon: raise default minimum API version to v1.24 1 năm trước cách đây
..
buildkit 74d9850bb9 client/buildkit: ClientOpts: update docs to use doc-links, and inline 2 năm trước cách đây
testdata 7c36a1af03 Move engine-api client package 9 năm trước cách đây
README.md 8641d2da3b client: update example in readme 1 năm trước cách đây
build_cancel.go 8128a9a478 Fix grammar in client function comments 4 năm trước cách đây
build_prune.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
checkpoint_create.go b688af2226 api/types: move checkpoint-types to api/types/checkpoint 1 năm trước cách đây
checkpoint_create_test.go b688af2226 api/types: move checkpoint-types to api/types/checkpoint 1 năm trước cách đây
checkpoint_delete.go b688af2226 api/types: move checkpoint-types to api/types/checkpoint 1 năm trước cách đây
checkpoint_delete_test.go b688af2226 api/types: move checkpoint-types to api/types/checkpoint 1 năm trước cách đây
checkpoint_list.go b688af2226 api/types: move checkpoint-types to api/types/checkpoint 1 năm trước cách đây
checkpoint_list_test.go b688af2226 api/types: move checkpoint-types to api/types/checkpoint 1 năm trước cách đây
client.go 08e4e88482 daemon: raise default minimum API version to v1.24 1 năm trước cách đây
client_deprecated.go 6b9968e8b1 client: deprecate NewClient properly 2 năm trước cách đây
client_mock_test.go 642e9917ff Add otel support 1 năm trước cách đây
client_test.go 981a878cf5 vendor: github.com/docker/go-connections fa09c952e3ea (v0.5.0-dev) 1 năm trước cách đây
client_unix.go ab35df454d remove pre-go1.17 build-tags 2 năm trước cách đây
client_windows.go 31ee158394 client: defaultHTTPClient() accept URL 2 năm trước cách đây
config_create.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
config_create_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
config_inspect.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
config_inspect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
config_list.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
config_list_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
config_remove.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
config_remove_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
config_update.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
config_update_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_attach.go 30f09b4a1a api/types: move ContainerAttachOptions to api/types/container 1 năm trước cách đây
container_commit.go 9498d897ab api/types: move ContainerCommitOptions to api/types/container 1 năm trước cách đây
container_commit_test.go 9498d897ab api/types: move ContainerCommitOptions to api/types/container 1 năm trước cách đây
container_copy.go 013d648888 client: CopyToContainer(), CopyFromContainer(): remove status-code handling 3 năm trước cách đây
container_copy_test.go 0af6d9e291 client: format code with gofumpt 2 năm trước cách đây
container_create.go ee9f0ed895 api: Deprecate ContainerConfig.MacAddress 1 năm trước cách đây
container_create_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_diff.go dbb48e4b29 api/types/container: create type for changes endpoint 2 năm trước cách đây
container_diff_test.go 66cf0e3f55 client: slightly improve ContainerDiff tests 2 năm trước cách đây
container_exec.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
container_exec_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_export.go 7d62e40f7e Switch from x/net/context -> context 7 năm trước cách đây
container_export_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_inspect.go 45067cda33 client: remove wrapResponseError() 3 năm trước cách đây
container_inspect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_kill.go b365924ec3 client: ContainerKill(): don't send signal query-param if none was set 3 năm trước cách đây
container_kill_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_list.go 9670d9364d api/types: move ContainerListOptions to api/types/container 1 năm trước cách đây
container_list_test.go 9670d9364d api/types: move ContainerListOptions to api/types/container 1 năm trước cách đây
container_logs.go ebef4efb88 api/types: move ContainerLogsOptions to api/types/container 1 năm trước cách đây
container_logs_test.go ebef4efb88 api/types: move ContainerLogsOptions to api/types/container 1 năm trước cách đây
container_pause.go 7d62e40f7e Switch from x/net/context -> context 7 năm trước cách đây
container_pause_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_prune.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
container_prune_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_remove.go 0f77875220 api/types: move ContainerRemoveOptions to api/types/container 1 năm trước cách đây
container_remove_test.go 0f77875220 api/types: move ContainerRemoveOptions to api/types/container 1 năm trước cách đây
container_rename.go 7d62e40f7e Switch from x/net/context -> context 7 năm trước cách đây
container_rename_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_resize.go 95b92b1f97 api/types: move ResizeOptions to api/types/container 1 năm trước cách đây
container_resize_test.go 95b92b1f97 api/types: move ResizeOptions to api/types/container 1 năm trước cách đây
container_restart.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
container_restart_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_start.go 7bce33eb0f api/types: move ContainerStartOptions to api/types/container 1 năm trước cách đây
container_start_test.go 7bce33eb0f api/types: move ContainerStartOptions to api/types/container 1 năm trước cách đây
container_stats.go 2da589d454 client: return explicit "nil" for no errors, and remove nil check 2 năm trước cách đây
container_stats_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_stop.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
container_stop_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_top.go 9c846b2fcc Client: always call ensureReaderClosed 6 năm trước cách đây
container_top_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_unpause.go 7d62e40f7e Switch from x/net/context -> context 7 năm trước cách đây
container_unpause_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_update.go 8128a9a478 Fix grammar in client function comments 4 năm trước cách đây
container_update_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
container_wait.go 0d27579fc7 Ensure that non-JSON-parsing errors are returned to the caller 1 năm trước cách đây
container_wait_test.go 0d27579fc7 Ensure that non-JSON-parsing errors are returned to the caller 1 năm trước cách đây
disk_usage.go 47ad2f3dd6 API,daemon: support `type` URL parameter to /system/df 4 năm trước cách đây
disk_usage_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
distribution_inspect.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
distribution_inspect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
envvars.go 5979d6e7e3 client: add const for environment variables, and document them 3 năm trước cách đây
errors.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
events.go cd51c9fafb client: fix empty-lines (revive) 2 năm trước cách đây
events_test.go 0f871f8cb7 api/types/events: define "Action" type and consts 1 năm trước cách đây
hijack.go 25fb4dd50d switch to go.opentelemetry.io/otel/semconv/v1.17.0 1 năm trước cách đây
hijack_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 năm trước cách đây
image_build.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
image_build_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
image_create.go 1148a24e64 migrate to new github.com/distribution/reference module 1 năm trước cách đây
image_create_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
image_history.go 9c846b2fcc Client: always call ensureReaderClosed 6 năm trước cách đây
image_history_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
image_import.go 1148a24e64 migrate to new github.com/distribution/reference module 1 năm trước cách đây
image_import_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
image_inspect.go 45067cda33 client: remove wrapResponseError() 3 năm trước cách đây
image_inspect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
image_list.go 48cacbca24 api/types: move image-types to api/types/image 1 năm trước cách đây
image_list_test.go 48cacbca24 api/types: move image-types to api/types/image 1 năm trước cách đây
image_load.go 83477ce8d0 client: remove custom "headers" type, and use "http.Header" instead 2 năm trước cách đây
image_load_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
image_prune.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
image_prune_test.go 48cacbca24 api/types: move image-types to api/types/image 1 năm trước cách đây
image_pull.go 1148a24e64 migrate to new github.com/distribution/reference module 1 năm trước cách đây
image_pull_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
image_push.go 1148a24e64 migrate to new github.com/distribution/reference module 1 năm trước cách đây
image_push_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
image_remove.go 48cacbca24 api/types: move image-types to api/types/image 1 năm trước cách đây
image_remove_test.go 48cacbca24 api/types: move image-types to api/types/image 1 năm trước cách đây
image_save.go 7d62e40f7e Switch from x/net/context -> context 7 năm trước cách đây
image_save_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
image_search.go 83477ce8d0 client: remove custom "headers" type, and use "http.Header" instead 2 năm trước cách đây
image_search_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
image_tag.go 1148a24e64 migrate to new github.com/distribution/reference module 1 năm trước cách đây
image_tag_test.go c243efb0cd client: TestImageTagInvalidSourceImageName remove invalid test-case 1 năm trước cách đây
info.go c90229ed9a api/types: move system info types to api/types/system 2 năm trước cách đây
info_test.go c90229ed9a api/types: move system info types to api/types/system 2 năm trước cách đây
interface.go ebef4efb88 api/types: move ContainerLogsOptions to api/types/container 1 năm trước cách đây
interface_experimental.go b688af2226 api/types: move checkpoint-types to api/types/checkpoint 1 năm trước cách đây
interface_stable.go 4f0d95fa6e Add canonical import comment 7 năm trước cách đây
login.go eaf1a604f2 client: use types/registry.AuthConfig 3 năm trước cách đây
network_connect.go 7d62e40f7e Switch from x/net/context -> context 7 năm trước cách đây
network_connect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
network_create.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
network_create_test.go 78479b1915 libnet: Make sure network names are unique 1 năm trước cách đây
network_disconnect.go 7d62e40f7e Switch from x/net/context -> context 7 năm trước cách đây
network_disconnect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
network_inspect.go 45067cda33 client: remove wrapResponseError() 3 năm trước cách đây
network_inspect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
network_list.go 5f47cef514 fix nolint comments for SA1019: filters.ToParamWithVersion is deprecated 5 năm trước cách đây
network_list_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
network_prune.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
network_prune_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
network_remove.go 45067cda33 client: remove wrapResponseError() 3 năm trước cách đây
network_remove_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
node_inspect.go 45067cda33 client: remove wrapResponseError() 3 năm trước cách đây
node_inspect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
node_list.go 0af6d9e291 client: format code with gofumpt 2 năm trước cách đây
node_list_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
node_remove.go 45067cda33 client: remove wrapResponseError() 3 năm trước cách đây
node_remove_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
node_update.go d9524d92a9 api/types/swarm: Version: implement stringer interface 3 năm trước cách đây
node_update_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
options.go 642e9917ff Add otel support 1 năm trước cách đây
options_test.go a6048fc792 client: add WithUserAgent() option 2 năm trước cách đây
ping.go 4cc796ab93 client: Client.buildRequest: use http.NewRequestWithContext 2 năm trước cách đây
ping_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
plugin_create.go 9c846b2fcc Client: always call ensureReaderClosed 6 năm trước cách đây
plugin_disable.go 7d62e40f7e Switch from x/net/context -> context 7 năm trước cách đây
plugin_disable_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
plugin_enable.go 7d62e40f7e Switch from x/net/context -> context 7 năm trước cách đây
plugin_enable_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
plugin_inspect.go 45067cda33 client: remove wrapResponseError() 3 năm trước cách đây
plugin_inspect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
plugin_install.go 1148a24e64 migrate to new github.com/distribution/reference module 1 năm trước cách đây
plugin_list.go 45067cda33 client: remove wrapResponseError() 3 năm trước cách đây
plugin_list_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
plugin_push.go 83477ce8d0 client: remove custom "headers" type, and use "http.Header" instead 2 năm trước cách đây
plugin_push_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
plugin_remove.go 45067cda33 client: remove wrapResponseError() 3 năm trước cách đây
plugin_remove_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
plugin_set.go 7d62e40f7e Switch from x/net/context -> context 7 năm trước cách đây
plugin_set_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
plugin_upgrade.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
request.go 4cc796ab93 client: Client.buildRequest: use http.NewRequestWithContext 2 năm trước cách đây
request_test.go 9670d9364d api/types: move ContainerListOptions to api/types/container 1 năm trước cách đây
secret_create.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
secret_create_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
secret_inspect.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
secret_inspect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
secret_list.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
secret_list_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
secret_remove.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
secret_remove_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
secret_update.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
secret_update_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
service_create.go ec69501e94 api/types: move ServiceCreateResponse, and generate from swagger 1 năm trước cách đây
service_create_test.go ec69501e94 api/types: move ServiceCreateResponse, and generate from swagger 1 năm trước cách đây
service_inspect.go 45067cda33 client: remove wrapResponseError() 3 năm trước cách đây
service_inspect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
service_list.go f36042d259 Add support for sending down service Running and Desired task counts 5 năm trước cách đây
service_list_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
service_logs.go ebef4efb88 api/types: move ContainerLogsOptions to api/types/container 1 năm trước cách đây
service_logs_test.go ebef4efb88 api/types: move ContainerLogsOptions to api/types/container 1 năm trước cách đây
service_remove.go 45067cda33 client: remove wrapResponseError() 3 năm trước cách đây
service_remove_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
service_update.go 5b3e6555a3 api/types: move ServiceUpdateResponse 1 năm trước cách đây
service_update_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
swarm_get_unlock_key.go 9c846b2fcc Client: always call ensureReaderClosed 6 năm trước cách đây
swarm_get_unlock_key_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
swarm_init.go 9c846b2fcc Client: always call ensureReaderClosed 6 năm trước cách đây
swarm_init_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
swarm_inspect.go 9c846b2fcc Client: always call ensureReaderClosed 6 năm trước cách đây
swarm_inspect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
swarm_join.go 7d62e40f7e Switch from x/net/context -> context 7 năm trước cách đây
swarm_join_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
swarm_leave.go 7d62e40f7e Switch from x/net/context -> context 7 năm trước cách đây
swarm_leave_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
swarm_unlock.go 7d62e40f7e Switch from x/net/context -> context 7 năm trước cách đây
swarm_unlock_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
swarm_update.go d9524d92a9 api/types/swarm: Version: implement stringer interface 3 năm trước cách đây
swarm_update_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
task_inspect.go 45067cda33 client: remove wrapResponseError() 3 năm trước cách đây
task_inspect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
task_list.go 9c846b2fcc Client: always call ensureReaderClosed 6 năm trước cách đây
task_list_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
task_logs.go ebef4efb88 api/types: move ContainerLogsOptions to api/types/container 1 năm trước cách đây
utils.go 4f0d95fa6e Add canonical import comment 7 năm trước cách đây
version.go 9c846b2fcc Client: always call ensureReaderClosed 6 năm trước cách đây
volume_create.go 64e96932bd api: rename volume.VolumeCreateBody to volume.CreateOptions 3 năm trước cách đây
volume_create_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
volume_inspect.go 176f66df9c api/types: replace uses of deprecated types.Volume with volume.Volume 3 năm trước cách đây
volume_inspect_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
volume_list.go 340711db3d api: add types/volume.ListOptions for a more consistent API 3 năm trước cách đây
volume_list_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
volume_prune.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
volume_remove.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
volume_remove_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây
volume_update.go e6907243af client: negotiate api version before handling version-specific code 1 năm trước cách đây
volume_update_test.go 66ff1e063e client: update error-assertions in tests 2 năm trước cách đây

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 all containers (the equivalent of docker ps --all):

package main

import (
	"context"
	"fmt"

	"github.com/docker/docker/api/types/container"
	"github.com/docker/docker/client"
)

func main() {
	apiClient, err := client.NewClientWithOpts(client.FromEnv)
	if err != nil {
		panic(err)
	}
	defer apiClient.Close()

	containers, err := apiClient.ContainerList(context.Background(), container.ListOptions{All: true})
	if err != nil {
		panic(err)
	}

	for _, ctr := range containers {
		fmt.Printf("%s %s (status: %s)\n", ctr.ID, ctr.Image, ctr.Status)
	}
}

Full documentation is available on pkg.go.dev.