Brian Goff 2216d3ca8d Add health start interval преди 5 години
..
buildkit 713c9280ca Move buildkit client opts to new package преди 2 години
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 07b2e4cb79 client: use strconv instead of fmt.Sprintf() преди 2 години
checkpoint_create.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
checkpoint_create_test.go 0af6d9e291 client: format code with gofumpt преди 2 години
checkpoint_delete.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
checkpoint_delete_test.go 0af6d9e291 client: format code with gofumpt преди 2 години
checkpoint_list.go 45067cda33 client: remove wrapResponseError() преди 3 години
checkpoint_list_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
client.go a6048fc792 client: add WithUserAgent() option преди 2 години
client_deprecated.go 6b9968e8b1 client: deprecate NewClient properly преди 2 години
client_mock_test.go c55a4ac779 refactor: move from io/ioutil to io and os package преди 3 години
client_test.go 31ee158394 client: defaultHTTPClient() accept URL преди 2 години
client_unix.go ab35df454d remove pre-go1.17 build-tags преди 2 години
client_windows.go 31ee158394 client: defaultHTTPClient() accept URL преди 2 години
config_create.go 8128a9a478 Fix grammar in client function comments преди 4 години
config_create_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
config_inspect.go 45067cda33 client: remove wrapResponseError() преди 3 години
config_inspect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
config_list.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
config_list_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
config_remove.go 45067cda33 client: remove wrapResponseError() преди 3 години
config_remove_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
config_update.go d9524d92a9 api/types/swarm: Version: implement stringer interface преди 3 години
config_update_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_attach.go 52c1a2fae8 gofmt GoDoc comments with go1.19 преди 3 години
container_commit.go 8128a9a478 Fix grammar in client function comments преди 4 години
container_commit_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_copy.go 013d648888 client: CopyToContainer(), CopyFromContainer(): remove status-code handling преди 3 години
container_copy_test.go 0af6d9e291 client: format code with gofumpt преди 2 години
container_create.go 2216d3ca8d Add health start interval преди 2 години
container_create_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_diff.go dbb48e4b29 api/types/container: create type for changes endpoint преди 2 години
container_diff_test.go 66cf0e3f55 client: slightly improve ContainerDiff tests преди 2 години
container_exec.go 56a20dbc19 container/exec: Support ConsoleSize преди 3 години
container_exec_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_export.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
container_export_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_inspect.go 45067cda33 client: remove wrapResponseError() преди 3 години
container_inspect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_kill.go b365924ec3 client: ContainerKill(): don't send signal query-param if none was set преди 3 години
container_kill_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_list.go 0af6d9e291 client: format code with gofumpt преди 2 години
container_list_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_logs.go 52c1a2fae8 gofmt GoDoc comments with go1.19 преди 3 години
container_logs_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_pause.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
container_pause_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_prune.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
container_prune_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_remove.go 45067cda33 client: remove wrapResponseError() преди 3 години
container_remove_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_rename.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
container_rename_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_resize.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
container_resize_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_restart.go e8fa708ae5 client: ContainerStop(), ContainerRestart(): support stop-signal преди 3 години
container_restart_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_start.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
container_start_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_stats.go ce1ceeb257 Add stats options to not prime the stats преди 5 години
container_stats_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_stop.go e8fa708ae5 client: ContainerStop(), ContainerRestart(): support stop-signal преди 3 години
container_stop_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_top.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
container_top_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_unpause.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
container_unpause_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_update.go 8128a9a478 Fix grammar in client function comments преди 4 години
container_update_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
container_wait.go 9900c7a348 client: improve error messaging on crash преди 2 години
container_wait_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
disk_usage.go 47ad2f3dd6 API,daemon: support `type` URL parameter to /system/df преди 4 години
disk_usage_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
distribution_inspect.go 857cb260c7 api: add const for 'X-Registry-Auth' преди 3 години
distribution_inspect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
envvars.go 5979d6e7e3 client: add const for environment variables, and document them преди 3 години
errors.go 685b3d820a client: make IsErrNotFound an alias for errdefs.IsNotFound преди 2 години
events.go cd51c9fafb client: fix empty-lines (revive) преди 2 години
events_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
hijack.go af5d83a641 Make it explicit raw|multiplexed stream implementation being used преди 3 години
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 66ff1e063e client: update error-assertions in tests преди 2 години
image_create.go 857cb260c7 api: add const for 'X-Registry-Auth' преди 3 години
image_create_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
image_history.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
image_history_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
image_import.go 8128a9a478 Fix grammar in client function comments преди 4 години
image_import_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
image_inspect.go 45067cda33 client: remove wrapResponseError() преди 3 години
image_inspect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
image_list.go 3d97f1e22d client/list: Handle SharedSize преди 2 години
image_list_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
image_load.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
image_load_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
image_prune.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
image_prune_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
image_pull.go 0cafc84fb2 Use errdefs for handling errors in client преди 6 години
image_pull_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
image_push.go 857cb260c7 api: add const for 'X-Registry-Auth' преди 3 години
image_push_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
image_remove.go 45067cda33 client: remove wrapResponseError() преди 3 години
image_remove_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
image_save.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
image_save_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
image_search.go 857cb260c7 api: add const for 'X-Registry-Auth' преди 3 години
image_search_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
image_tag.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
image_tag_test.go 4e69e16fde client: use string-literals for easier grep'ing преди 2 години
info.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
info_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
interface.go 307b09e7eb fixing consistent aliases for OCI spec imports преди 2 години
interface_experimental.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
interface_stable.go 4f0d95fa6e Add canonical import comment преди 7 години
login.go eaf1a604f2 client: use types/registry.AuthConfig преди 3 години
network_connect.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
network_connect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
network_create.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
network_create_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
network_disconnect.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
network_disconnect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
network_inspect.go 45067cda33 client: remove wrapResponseError() преди 3 години
network_inspect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
network_list.go 5f47cef514 fix nolint comments for SA1019: filters.ToParamWithVersion is deprecated преди 5 години
network_list_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
network_prune.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
network_prune_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
network_remove.go 45067cda33 client: remove wrapResponseError() преди 3 години
network_remove_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
node_inspect.go 45067cda33 client: remove wrapResponseError() преди 3 години
node_inspect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
node_list.go 0af6d9e291 client: format code with gofumpt преди 2 години
node_list_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
node_remove.go 45067cda33 client: remove wrapResponseError() преди 3 години
node_remove_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
node_update.go d9524d92a9 api/types/swarm: Version: implement stringer interface преди 3 години
node_update_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
options.go a6048fc792 client: add WithUserAgent() option преди 2 години
options_test.go a6048fc792 client: add WithUserAgent() option преди 2 години
ping.go 19cd5ff164 client: use strings.Cut() преди 2 години
ping_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
plugin_create.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
plugin_disable.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
plugin_disable_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
plugin_enable.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
plugin_enable_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
plugin_inspect.go 45067cda33 client: remove wrapResponseError() преди 3 години
plugin_inspect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
plugin_install.go 7f0cf432e9 client: remove redundant pluginPermissionDenied преди 2 години
plugin_list.go 45067cda33 client: remove wrapResponseError() преди 3 години
plugin_list_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
plugin_push.go 857cb260c7 api: add const for 'X-Registry-Auth' преди 3 години
plugin_push_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
plugin_remove.go 45067cda33 client: remove wrapResponseError() преди 3 години
plugin_remove_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
plugin_set.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
plugin_set_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
plugin_upgrade.go 857cb260c7 api: add const for 'X-Registry-Auth' преди 3 години
request.go a6048fc792 client: add WithUserAgent() option преди 2 години
request_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
secret_create.go 8128a9a478 Fix grammar in client function comments преди 4 години
secret_create_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
secret_inspect.go 45067cda33 client: remove wrapResponseError() преди 3 години
secret_inspect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
secret_list.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
secret_list_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
secret_remove.go 45067cda33 client: remove wrapResponseError() преди 3 години
secret_remove_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
secret_update.go d9524d92a9 api/types/swarm: Version: implement stringer interface преди 3 години
secret_update_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
service_create.go 857cb260c7 api: add const for 'X-Registry-Auth' преди 3 години
service_create_test.go 0af6d9e291 client: format code with gofumpt преди 2 години
service_inspect.go 45067cda33 client: remove wrapResponseError() преди 3 години
service_inspect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
service_list.go f36042d259 Add support for sending down service Running and Desired task counts преди 5 години
service_list_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
service_logs.go 48cfe3f087 Improve GetTimestamp parsing преди 7 години
service_logs_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
service_remove.go 45067cda33 client: remove wrapResponseError() преди 3 години
service_remove_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
service_update.go 857cb260c7 api: add const for 'X-Registry-Auth' преди 3 години
service_update_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
swarm_get_unlock_key.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
swarm_get_unlock_key_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
swarm_init.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
swarm_init_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
swarm_inspect.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
swarm_inspect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
swarm_join.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
swarm_join_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
swarm_leave.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
swarm_leave_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
swarm_unlock.go 7d62e40f7e Switch from x/net/context -> context преди 7 години
swarm_unlock_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
swarm_update.go d9524d92a9 api/types/swarm: Version: implement stringer interface преди 3 години
swarm_update_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
task_inspect.go 45067cda33 client: remove wrapResponseError() преди 3 години
task_inspect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
task_list.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
task_list_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
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 64e96932bd api: rename volume.VolumeCreateBody to volume.CreateOptions преди 3 години
volume_create_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
volume_inspect.go 176f66df9c api/types: replace uses of deprecated types.Volume with volume.Volume преди 3 години
volume_inspect_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
volume_list.go 340711db3d api: add types/volume.ListOptions for a more consistent API преди 3 години
volume_list_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
volume_prune.go 9c846b2fcc Client: always call ensureReaderClosed преди 6 години
volume_remove.go 45067cda33 client: remove wrapResponseError() преди 3 години
volume_remove_test.go 66ff1e063e client: update error-assertions in tests преди 2 години
volume_update.go d9524d92a9 api/types/swarm: Version: implement stringer interface преди 3 години
volume_update_test.go 66ff1e063e client: update error-assertions in tests преди 2 години

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.