Sebastiaan van Stijn 2597a71623 client: ignore kernel-memory on API >= 1.42 3 years ago
..
testdata 7c36a1af03 Move engine-api client package 9 years ago
README.md c8ff5ecc09 Remove use of deprecated client.NewEnvClient() 6 years ago
build_cancel.go 8128a9a478 Fix grammar in client function comments 4 years ago
build_prune.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
checkpoint_create.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
checkpoint_create_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
checkpoint_delete.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
checkpoint_delete_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
checkpoint_list.go 45067cda33 client: remove wrapResponseError() 3 years ago
checkpoint_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
client.go 52c1a2fae8 gofmt GoDoc comments with go1.19 3 years ago
client_deprecated.go 69d9ff3455 Move deprecated client constructors to a separate file 6 years ago
client_mock_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
client_test.go a5f6500958 replace deprecated gotest.tools' env.Patch() with t.SetEnv() 3 years ago
client_unix.go 5979d6e7e3 client: add const for environment variables, and document them 3 years ago
client_windows.go 5979d6e7e3 client: add const for environment variables, and document them 3 years ago
config_create.go 8128a9a478 Fix grammar in client function comments 4 years ago
config_create_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
config_inspect.go 45067cda33 client: remove wrapResponseError() 3 years ago
config_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
config_list.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
config_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
config_remove.go 45067cda33 client: remove wrapResponseError() 3 years ago
config_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
config_update.go d9524d92a9 api/types/swarm: Version: implement stringer interface 3 years ago
config_update_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_attach.go 52c1a2fae8 gofmt GoDoc comments with go1.19 3 years ago
container_commit.go 8128a9a478 Fix grammar in client function comments 4 years ago
container_commit_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_copy.go 013d648888 client: CopyToContainer(), CopyFromContainer(): remove status-code handling 3 years ago
container_copy_test.go 013d648888 client: CopyToContainer(), CopyFromContainer(): remove status-code handling 3 years ago
container_create.go 2597a71623 client: ignore kernel-memory on API >= 1.42 2 years ago
container_create_test.go 41b96bff55 update uses of container.ContainerCreateCreatedBody to CreateResponse 3 years ago
container_diff.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
container_diff_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_exec.go 56a20dbc19 container/exec: Support ConsoleSize 3 years ago
container_exec_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_export.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
container_export_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_inspect.go 45067cda33 client: remove wrapResponseError() 3 years ago
container_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_kill.go b365924ec3 client: ContainerKill(): don't send signal query-param if none was set 3 years ago
container_kill_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_list.go 890231f46b client: container ps: don't set "limit" if none was set 3 years ago
container_list_test.go 890231f46b client: container ps: don't set "limit" if none was set 3 years ago
container_logs.go 52c1a2fae8 gofmt GoDoc comments with go1.19 3 years ago
container_logs_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_pause.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
container_pause_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_prune.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
container_prune_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_remove.go 45067cda33 client: remove wrapResponseError() 3 years ago
container_remove_test.go 45067cda33 client: remove wrapResponseError() 3 years ago
container_rename.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
container_rename_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_resize.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
container_resize_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_restart.go e8fa708ae5 client: ContainerStop(), ContainerRestart(): support stop-signal 3 years ago
container_restart_test.go e8fa708ae5 client: ContainerStop(), ContainerRestart(): support stop-signal 3 years ago
container_start.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
container_start_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_stats.go ce1ceeb257 Add stats options to not prime the stats 5 years ago
container_stats_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_stop.go e8fa708ae5 client: ContainerStop(), ContainerRestart(): support stop-signal 3 years ago
container_stop_test.go e8fa708ae5 client: ContainerStop(), ContainerRestart(): support stop-signal 3 years ago
container_top.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
container_top_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_unpause.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
container_unpause_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_update.go 8128a9a478 Fix grammar in client function comments 4 years ago
container_update_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
container_wait.go 7293857456 api: rename ContainerWaitOKBody to container.WaitResponse 3 years ago
container_wait_test.go 7293857456 api: rename ContainerWaitOKBody to container.WaitResponse 3 years ago
disk_usage.go 47ad2f3dd6 API,daemon: support `type` URL parameter to /system/df 4 years ago
disk_usage_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
distribution_inspect.go 857cb260c7 api: add const for 'X-Registry-Auth' 3 years ago
distribution_inspect_test.go 9f0b3f5609 bump gotest.tools v3.0.1 for compatibility with Go 1.14 5 years ago
envvars.go 5979d6e7e3 client: add const for environment variables, and document them 3 years ago
errors.go 7f0cf432e9 client: remove redundant pluginPermissionDenied 2 years ago
events.go 5f47cef514 fix nolint comments for SA1019: filters.ToParamWithVersion is deprecated 5 years ago
events_test.go 0cd1bd42b4 Merge pull request #42770 from thaJeztah/eventtype_enums 3 years ago
hijack.go af5d83a641 Make it explicit raw|multiplexed stream implementation being used 3 years ago
hijack_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
image_build.go 8128a9a478 Fix grammar in client function comments 4 years ago
image_build_test.go eaf1a604f2 client: use types/registry.AuthConfig 3 years ago
image_create.go 857cb260c7 api: add const for 'X-Registry-Auth' 3 years ago
image_create_test.go 857cb260c7 api: add const for 'X-Registry-Auth' 3 years ago
image_history.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
image_history_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
image_import.go 8128a9a478 Fix grammar in client function comments 4 years ago
image_import_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
image_inspect.go 45067cda33 client: remove wrapResponseError() 3 years ago
image_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
image_list.go 5f47cef514 fix nolint comments for SA1019: filters.ToParamWithVersion is deprecated 5 years ago
image_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
image_load.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
image_load_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
image_prune.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
image_prune_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
image_pull.go 0cafc84fb2 Use errdefs for handling errors in client 6 years ago
image_pull_test.go e3a7a1c6ae client: linting: fix "invalid auth header" error 3 years ago
image_push.go 857cb260c7 api: add const for 'X-Registry-Auth' 3 years ago
image_push_test.go e3a7a1c6ae client: linting: fix "invalid auth header" error 3 years ago
image_remove.go 45067cda33 client: remove wrapResponseError() 3 years ago
image_remove_test.go 45067cda33 client: remove wrapResponseError() 3 years ago
image_save.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
image_save_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
image_search.go 857cb260c7 api: add const for 'X-Registry-Auth' 3 years ago
image_search_test.go e3a7a1c6ae client: linting: fix "invalid auth header" error 3 years ago
image_tag.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
image_tag_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
info.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
info_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
interface.go 340711db3d api: add types/volume.ListOptions for a more consistent API 3 years ago
interface_experimental.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
interface_stable.go 4f0d95fa6e Add canonical import comment 7 years ago
login.go eaf1a604f2 client: use types/registry.AuthConfig 3 years ago
network_connect.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
network_connect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
network_create.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
network_create_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
network_disconnect.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
network_disconnect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
network_inspect.go 45067cda33 client: remove wrapResponseError() 3 years ago
network_inspect_test.go 45067cda33 client: remove wrapResponseError() 3 years ago
network_list.go 5f47cef514 fix nolint comments for SA1019: filters.ToParamWithVersion is deprecated 5 years ago
network_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
network_prune.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
network_prune_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
network_remove.go 45067cda33 client: remove wrapResponseError() 3 years ago
network_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
node_inspect.go 45067cda33 client: remove wrapResponseError() 3 years ago
node_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
node_list.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
node_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
node_remove.go 45067cda33 client: remove wrapResponseError() 3 years ago
node_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
node_update.go d9524d92a9 api/types/swarm: Version: implement stringer interface 3 years ago
node_update_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
options.go e14924570c client: remove deprecated WithDialer() option 2 years ago
options_test.go a5f6500958 replace deprecated gotest.tools' env.Patch() with t.SetEnv() 3 years ago
ping.go 1e645fb70f client: Ping(): add handling for swarm status headers 3 years ago
ping_test.go 1e645fb70f client: Ping(): add handling for swarm status headers 3 years ago
plugin_create.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
plugin_disable.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
plugin_disable_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
plugin_enable.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
plugin_enable_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
plugin_inspect.go 45067cda33 client: remove wrapResponseError() 3 years ago
plugin_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
plugin_install.go 7f0cf432e9 client: remove redundant pluginPermissionDenied 2 years ago
plugin_list.go 45067cda33 client: remove wrapResponseError() 3 years ago
plugin_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
plugin_push.go 857cb260c7 api: add const for 'X-Registry-Auth' 3 years ago
plugin_push_test.go e3a7a1c6ae client: linting: fix "invalid auth header" error 3 years ago
plugin_remove.go 45067cda33 client: remove wrapResponseError() 3 years ago
plugin_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
plugin_set.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
plugin_set_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
plugin_upgrade.go 857cb260c7 api: add const for 'X-Registry-Auth' 3 years ago
request.go 10c56efa97 linting: error strings should not be capitalized (revive) 3 years ago
request_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
secret_create.go 8128a9a478 Fix grammar in client function comments 4 years ago
secret_create_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
secret_inspect.go 45067cda33 client: remove wrapResponseError() 3 years ago
secret_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
secret_list.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
secret_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
secret_remove.go 45067cda33 client: remove wrapResponseError() 3 years ago
secret_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
secret_update.go d9524d92a9 api/types/swarm: Version: implement stringer interface 3 years ago
secret_update_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
service_create.go 857cb260c7 api: add const for 'X-Registry-Auth' 3 years ago
service_create_test.go a0230f3d9a remove unneeded "digest" alias for "go-digest" 3 years ago
service_inspect.go 45067cda33 client: remove wrapResponseError() 3 years ago
service_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
service_list.go f36042d259 Add support for sending down service Running and Desired task counts 5 years ago
service_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
service_logs.go 48cfe3f087 Improve GetTimestamp parsing 7 years ago
service_logs_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
service_remove.go 45067cda33 client: remove wrapResponseError() 3 years ago
service_remove_test.go 45067cda33 client: remove wrapResponseError() 3 years ago
service_update.go 857cb260c7 api: add const for 'X-Registry-Auth' 3 years ago
service_update_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
swarm_get_unlock_key.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
swarm_get_unlock_key_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
swarm_init.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
swarm_init_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
swarm_inspect.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
swarm_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
swarm_join.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
swarm_join_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
swarm_leave.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
swarm_leave_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
swarm_unlock.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
swarm_unlock_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
swarm_update.go d9524d92a9 api/types/swarm: Version: implement stringer interface 3 years ago
swarm_update_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
task_inspect.go 45067cda33 client: remove wrapResponseError() 3 years ago
task_inspect_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
task_list.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
task_list_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
task_logs.go 7d62e40f7e Switch from x/net/context -> context 7 years ago
transport.go 4f0d95fa6e Add canonical import comment 7 years ago
utils.go 4f0d95fa6e Add canonical import comment 7 years ago
version.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
volume_create.go 64e96932bd api: rename volume.VolumeCreateBody to volume.CreateOptions 3 years ago
volume_create_test.go 64e96932bd api: rename volume.VolumeCreateBody to volume.CreateOptions 3 years ago
volume_inspect.go 176f66df9c api/types: replace uses of deprecated types.Volume with volume.Volume 3 years ago
volume_inspect_test.go 3cae9fef16 imports: remove "volumetypes" aliases for api/types/volume 3 years ago
volume_list.go 340711db3d api: add types/volume.ListOptions for a more consistent API 3 years ago
volume_list_test.go 340711db3d api: add types/volume.ListOptions for a more consistent API 3 years ago
volume_prune.go 9c846b2fcc Client: always call ensureReaderClosed 6 years ago
volume_remove.go 45067cda33 client: remove wrapResponseError() 3 years ago
volume_remove_test.go c55a4ac779 refactor: move from io/ioutil to io and os package 3 years ago
volume_update.go d9524d92a9 api/types/swarm: Version: implement stringer interface 3 years ago
volume_update_test.go 240a9fcb83 Add Swarm cluster volume supports 3 years ago

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.