StartContainerTest Go To Implementation

Methods

  • test_start_container

  • test_start_container_none

  • test_start_container_regression_573

  • test_start_container_with_lxc_conf

  • test_start_container_with_lxc_conf_compat

  • test_start_container_with_binds_ro

  • test_start_container_with_binds_rw

  • test_start_container_with_port_binds

  • test_start_container_with_links

  • test_start_container_with_multiple_links

  • test_start_container_with_links_as_list_of_tuples

  • test_start_container_privileged

  • test_start_container_with_dict_instead_of_id

Show
CreateContainerTest Go To Implementation

Methods

  • test_create_container

  • test_create_container_with_binds

  • test_create_container_with_volume_string

  • test_create_container_with_ports

  • test_create_container_with_entrypoint

  • test_create_container_with_host_config_cpu_shares

  • test_create_container_with_host_config_cpuset

  • test_create_container_with_host_config_cpuset_mems

  • test_create_container_with_cgroup_parent

  • test_create_container_with_working_dir

  • test_create_container_with_stdin_open

  • test_create_named_container

  • test_create_container_with_platform

  • test_create_container_with_mem_limit_as_int

  • test_create_container_with_mem_limit_as_string

  • test_create_container_with_mem_limit_as_string_with_k_unit

  • test_create_container_with_mem_limit_as_string_with_m_unit

  • test_create_container_with_mem_limit_as_string_with_g_unit

  • test_create_container_with_mem_limit_as_string_with_wrong_value

  • test_create_container_with_lxc_conf

  • test_create_container_with_lxc_conf_compat

  • test_create_container_with_binds_ro

  • test_create_container_with_binds_rw

  • test_create_container_with_binds_mode

  • test_create_container_with_binds_mode_and_ro_error

  • test_create_container_with_binds_list

  • test_create_container_with_port_binds

  • test_create_container_with_mac_address

  • test_create_container_with_links

  • test_create_container_with_multiple_links

  • test_create_container_with_links_as_list_of_tuples

  • test_create_container_privileged

  • test_create_container_with_restart_policy

  • test_create_container_with_added_capabilities

  • test_create_container_with_dropped_capabilities

  • test_create_container_with_devices

  • test_create_container_with_device_requests

  • test_create_container_with_labels_dict

  • test_create_container_with_labels_list

  • test_create_container_with_named_volume

  • test_create_container_with_stop_signal

  • test_create_container_with_aliases

  • test_create_container_with_tmpfs_list

  • test_create_container_with_tmpfs_dict

  • test_create_container_with_sysctl

  • test_create_container_with_unicode_envvars

  • test_create_container_with_host_config_cpus

  • test_create_container_with_cgroupns

Show
ContainerTest Go To Implementation

Methods

  • test_list_containers

  • test_resize_container

  • test_rename_container

  • test_wait

  • test_wait_with_dict_instead_of_id

  • test_logs

  • test_logs_with_dict_instead_of_id

  • test_log_streaming

  • test_log_following

  • test_log_following_backwards

  • test_log_streaming_and_following

  • test_log_tail

  • test_log_since

  • test_log_since_with_float

  • test_log_since_with_datetime

  • test_log_since_with_invalid_value_raises_error

  • test_log_tty

  • test_diff

  • test_diff_with_dict_instead_of_id

  • test_port

  • test_stop_container

  • test_stop_container_with_dict_instead_of_id

  • test_pause_container

  • test_unpause_container

  • test_kill_container

  • test_kill_container_with_dict_instead_of_id

  • test_kill_container_with_signal

  • test_restart_container

  • test_restart_container_with_dict_instead_of_id

  • test_remove_container

  • test_remove_container_with_dict_instead_of_id

  • test_export

  • test_export_with_dict_instead_of_id

  • test_inspect_container

  • test_inspect_container_undefined_id

  • test_container_stats

  • test_container_stats_without_streaming

  • test_container_stats_with_one_shot

  • test_container_top

  • test_container_top_with_psargs

  • test_container_update

Show
ListContainersTest Go To Implementation

Methods

  • test_list_containers

Show
CreateContainerTest Go To Implementation

Methods

  • test_create

  • test_create_with_host_pid_mode

  • test_create_with_links

  • test_create_with_restart_policy

  • test_create_container_with_volumes_from

  • create_container_readonly_fs

  • create_container_with_name

  • create_container_privileged

  • test_create_with_mac_address

  • test_create_with_cgroupns

  • test_group_id_ints

  • test_group_id_strings

  • test_valid_log_driver_and_log_opt

  • test_invalid_log_driver_raises_exception

  • test_valid_no_log_driver_specified

  • test_valid_no_config_specified

  • test_create_with_memory_constraints_with_str

  • test_create_with_memory_constraints_with_int

  • test_create_with_environment_variable_no_value

  • test_create_with_tmpfs

  • test_create_with_isolation

  • test_create_with_auto_remove

  • test_create_with_stop_timeout

  • test_create_with_storage_opt

  • test_create_with_init

  • test_create_with_cpu_rt_options

  • test_create_with_device_cgroup_rules

  • test_create_with_uts_mode

Show
ArchiveTest Go To Implementation

Methods

  • test_get_file_archive_from_container

  • test_get_file_stat_from_container

  • test_copy_file_to_container

  • test_copy_directory_to_container

Show
RenameContainerTest Go To Implementation

Methods

  • test_rename_container

Show
StartContainerTest Go To Implementation

Methods

  • test_start_container

  • test_start_container_with_dict_instead_of_id

  • test_run_shlex_commands

Show

Methods

  • test_wait

  • test_wait_with_dict_instead_of_id

  • test_wait_with_condition

Show

Methods

  • test_logs

  • test_logs_tail_option

  • test_logs_streaming_and_follow

  • test_logs_streaming_and_follow_and_cancel

  • test_logs_with_dict_instead_of_id

  • test_logs_with_tail_0

  • test_logs_with_until

Show

Methods

  • test_diff

  • test_diff_with_dict_instead_of_id

Show

Methods

  • test_stop

  • test_stop_with_dict_instead_of_id

Show

Methods

  • test_kill

  • test_kill_with_dict_instead_of_id

  • test_kill_with_signal

  • test_kill_with_signal_name

  • test_kill_with_signal_integer

Show

Methods

  • test_port

Show
ContainerTopTest Go To Implementation

Methods

  • test_top

  • test_top_with_psargs

Show
RestartContainerTest Go To Implementation

Methods

  • test_restart

  • test_restart_with_low_timeout

  • test_restart_with_dict_instead_of_id

Show
RemoveContainerTest Go To Implementation

Methods

  • test_remove

  • test_remove_with_dict_instead_of_id

Show
AttachContainerTest Go To Implementation

Methods

  • test_run_container_streaming

  • test_run_container_reading_socket_http

  • test_run_container_reading_socket_ws

  • test_attach_no_stream

  • test_attach_stream_and_cancel

  • test_detach_with_default

  • test_detach_with_config_file

  • test_detach_with_arg

Show

Methods

  • test_pause_unpause

Show

Methods

  • test_prune_containers

Show
GetContainerStatsTest Go To Implementation

Methods

  • test_get_container_stats_no_stream

Show
ContainerUpdateTest Go To Implementation

Methods

  • test_update_container

  • test_restart_policy_update

Show
ContainerCPUTest Go To Implementation

Methods

  • test_container_cpu_shares

  • test_container_cpuset

  • test_create_with_runtime

Show

Methods

  • test_remove_link

Show
DecoratorsTest Go To Implementation

Methods

  • test_update_headers

Show
KwargsFromEnvTest Go To Implementation

Methods

  • setUp

  • tearDown

  • test_kwargs_from_env_empty

  • test_kwargs_from_env_tls

  • test_kwargs_from_env_tls_verify_false

  • test_kwargs_from_env_tls_verify_false_no_cert

  • test_kwargs_from_env_no_cert_path

  • test_kwargs_from_env_alternate_env

Show
ConverVolumeBindsTest Go To Implementation

Methods

  • test_convert_volume_binds_empty

  • test_convert_volume_binds_list

  • test_convert_volume_binds_complete

  • test_convert_volume_binds_compact

  • test_convert_volume_binds_no_mode

  • test_convert_volume_binds_unicode_bytes_input

  • test_convert_volume_binds_unicode_unicode_input

Show
ParseEnvFileTest Go To Implementation

Methods

  • generate_tempfile

  • test_parse_env_file_proper

  • test_parse_env_file_with_equals_character

  • test_parse_env_file_commented_line

  • test_parse_env_file_newline

  • test_parse_env_file_invalid_line

Show
ParseHostTest Go To Implementation

Methods

  • test_parse_host

  • test_parse_host_empty_value

  • test_parse_host_tls

  • test_parse_host_tls_tcp_proto

  • test_parse_host_trailing_slash

Show
ParseRepositoryTagTest Go To Implementation

Methods

  • test_index_image_no_tag

  • test_index_image_tag

  • test_index_user_image_no_tag

  • test_index_user_image_tag

  • test_private_reg_image_no_tag

  • test_private_reg_image_tag

  • test_index_image_sha

  • test_private_reg_image_sha

Show
ParseDeviceTest Go To Implementation

Methods

  • test_dict

  • test_partial_string_definition

  • test_permissionless_string_definition

  • test_full_string_definition

  • test_hybrid_list

Show
ParseBytesTest Go To Implementation

Methods

  • test_parse_bytes_valid

  • test_parse_bytes_invalid

  • test_parse_bytes_float

Show

Methods

  • test_convert_filters

  • test_decode_json_header

Show
SplitCommandTest Go To Implementation

Methods

  • test_split_command_with_unicode

Show

Methods

  • test_split_port_with_host_ip

  • test_split_port_with_protocol

  • test_split_port_with_host_ip_no_port

  • test_split_port_range_with_host_ip_no_port

  • test_split_port_with_host_port

  • test_split_port_range_with_host_port

  • test_split_port_random_port_range_with_host_port

  • test_split_port_no_host_port

  • test_split_port_range_no_host_port

  • test_split_port_range_with_protocol

  • test_split_port_with_ipv6_address

  • test_split_port_with_ipv6_square_brackets_address

  • test_split_port_invalid

  • test_split_port_invalid_protocol

  • test_non_matching_length_port_ranges

  • test_port_and_range_invalid

  • test_port_only_with_colon

  • test_host_only_with_colon

  • test_with_no_container_port

  • test_split_port_empty_string

  • test_split_port_non_string

  • test_build_port_bindings_with_one_port

  • test_build_port_bindings_with_matching_internal_ports

  • test_build_port_bindings_with_nonmatching_internal_ports

  • test_build_port_bindings_with_port_range

  • test_build_port_bindings_with_matching_internal_port_ranges

  • test_build_port_bindings_with_nonmatching_internal_port_ranges

Show
FormatEnvironmentTest Go To Implementation

Methods

  • test_format_env_binary_unicode_value

  • test_format_env_no_value

Show
ServiceTest Go To Implementation

Methods

  • setup_class

  • teardown_class

  • tearDown

  • get_service_name

  • get_service_container

  • create_simple_service

  • test_list_services

  • test_list_services_filter_by_label

  • test_list_services_with_status

  • test_inspect_service_by_id

  • test_inspect_service_by_name

  • test_inspect_service_insert_defaults

  • test_remove_service_by_id

  • test_remove_service_by_name

  • test_create_service_simple

  • test_service_logs

  • test_create_service_custom_log_driver

  • test_create_service_with_volume_mount

  • test_create_service_with_resources_constraints

  • _create_service_with_generic_resources

  • test_create_service_with_generic_resources

  • test_create_service_with_invalid_generic_resources

  • test_create_service_with_update_config

  • test_create_service_with_failure_action_rollback

  • test_create_service_with_update_config_monitor

  • test_create_service_with_rollback_config

  • test_create_service_with_restart_policy

  • test_create_service_with_custom_networks

  • test_create_service_with_network_attachment_config

  • test_create_service_with_placement

  • test_create_service_with_placement_object

  • test_create_service_with_placement_platform

  • test_create_service_with_placement_preferences

  • test_create_service_with_placement_preferences_tuple

  • test_create_service_with_placement_maxreplicas

  • test_create_service_with_endpoint_spec

  • test_create_service_with_endpoint_spec_host_publish_mode

  • test_create_service_with_env

  • test_create_service_with_update_order

  • test_create_service_with_tty

  • test_create_service_with_tty_dict

  • test_create_service_global_mode

  • test_create_service_replicated_mode

  • test_create_service_global_job_mode

  • test_create_service_replicated_job_mode

  • test_update_service_force_update

  • test_create_service_with_secret

  • test_create_service_with_unicode_secret

  • test_create_service_with_config

  • test_create_service_with_unicode_config

  • test_create_service_with_hosts

  • test_create_service_with_hostname

  • test_create_service_with_groups

  • test_create_service_with_dns_config

  • test_create_service_with_healthcheck

  • test_create_service_with_readonly

  • test_create_service_with_stop_signal

  • test_create_service_with_privileges

  • test_create_service_with_init

  • test_update_service_with_defaults_name

  • test_update_service_with_defaults_labels

  • test_update_service_with_defaults_mode

  • test_update_service_with_defaults_container_labels

  • test_update_service_with_defaults_update_config

  • test_update_service_with_defaults_networks

  • test_update_service_with_defaults_endpoint_spec

  • test_update_service_remove_healthcheck

  • test_update_service_remove_labels

  • test_update_service_remove_container_labels

  • test_update_service_with_network_change

  • _update_service

  • test_create_service_cap_add

  • test_create_service_cap_drop

  • test_create_service_with_sysctl

Show
HostConfigTest Go To Implementation

Methods

  • test_create_host_config_no_options_newer_api_version

  • test_create_host_config_invalid_cpu_cfs_types

  • test_create_host_config_with_cpu_quota

  • test_create_host_config_with_cpu_period

  • test_create_host_config_with_blkio_constraints

  • test_create_host_config_with_shm_size

  • test_create_host_config_with_shm_size_in_mb

  • test_create_host_config_with_oom_kill_disable

  • test_create_host_config_with_userns_mode

  • test_create_host_config_with_uts

  • test_create_host_config_with_oom_score_adj

  • test_create_host_config_with_dns_opt

  • test_create_host_config_with_mem_reservation

  • test_create_host_config_with_kernel_memory

  • test_create_host_config_with_pids_limit

  • test_create_host_config_with_isolation

  • test_create_host_config_pid_mode

  • test_create_host_config_invalid_mem_swappiness

  • test_create_host_config_with_volume_driver

  • test_create_host_config_invalid_cpu_count_types

  • test_create_host_config_with_cpu_count

  • test_create_host_config_invalid_cpu_percent_types

  • test_create_host_config_with_cpu_percent

  • test_create_host_config_invalid_nano_cpus_types

  • test_create_host_config_with_nano_cpus

  • test_create_host_config_with_cpu_rt_period_types

  • test_create_host_config_with_cpu_rt_period

  • test_ctrate_host_config_with_cpu_rt_runtime_types

  • test_create_host_config_with_cpu_rt_runtime

Show
ContainerSpecTest Go To Implementation

Methods

  • test_parse_mounts

Show

Methods

  • test_create_host_config_dict_ulimit

  • test_create_host_config_dict_ulimit_capitals

  • test_create_host_config_obj_ulimit

  • test_ulimit_invalid_type

Show
LogConfigTest Go To Implementation

Methods

  • test_create_host_config_dict_logconfig

  • test_create_host_config_obj_logconfig

  • test_logconfig_invalid_config_type

Show
EndpointConfigTest Go To Implementation

Methods

  • test_create_endpoint_config_with_aliases

Show
IPAMConfigTest Go To Implementation

Methods

  • test_create_ipam_config

Show
ServiceModeTest Go To Implementation

Methods

  • test_replicated_simple

  • test_global_simple

  • test_replicated_job_simple

  • test_global_job_simple

  • test_global_replicas_error

  • test_global_job_replicas_simple

  • test_replicated_replicas

  • test_replicated_replicas_0

  • test_invalid_mode

Show

Methods

  • test_parse_mount_string_ro

  • test_parse_mount_string_rw

  • test_parse_mount_string_short_form

  • test_parse_mount_string_no_source

  • test_parse_mount_string_invalid

  • test_parse_mount_named_volume

  • test_parse_mount_bind

  • test_parse_mount_bind_windows

Show
ServicePortsTest Go To Implementation

Methods

  • test_convert_service_ports_simple

  • test_convert_service_ports_with_protocol

  • test_convert_service_ports_with_protocol_and_mode

  • test_convert_service_ports_invalid

  • test_convert_service_ports_no_protocol_and_mode

  • test_convert_service_ports_multiple

Show
RegressionTest Go To Implementation

Methods

  • test_803_urlsafe_encode

Show
ResolveRepositoryNameTest Go To Implementation

Methods

  • test_resolve_repository_name_hub_library_image

  • test_resolve_repository_name_dotted_hub_library_image

  • test_resolve_repository_name_hub_image

  • test_explicit_hub_index_library_image

  • test_explicit_legacy_hub_index_library_image

  • test_resolve_repository_name_private_registry

  • test_resolve_repository_name_private_registry_with_port

  • test_resolve_repository_name_private_registry_with_username

  • test_resolve_repository_name_no_dots_but_port

  • test_resolve_repository_name_no_dots_but_port_and_username

  • test_resolve_repository_name_localhost

  • test_resolve_repository_name_localhost_with_username

  • test_invalid_index_name

Show
ResolveAuthTest Go To Implementation

Methods

  • test_resolve_authconfig_hostname_only

  • test_resolve_authconfig_no_protocol

  • test_resolve_authconfig_no_path

  • test_resolve_authconfig_no_path_trailing_slash

  • test_resolve_authconfig_no_path_wrong_secure_proto

  • test_resolve_authconfig_no_path_wrong_insecure_proto

  • test_resolve_authconfig_path_wrong_proto

  • test_resolve_authconfig_default_registry

  • test_resolve_authconfig_default_explicit_none

  • test_resolve_authconfig_fully_explicit

  • test_resolve_authconfig_legacy_config

  • test_resolve_authconfig_no_match

  • test_resolve_registry_and_auth_library_image

  • test_resolve_registry_and_auth_hub_image

  • test_resolve_registry_and_auth_explicit_hub

  • test_resolve_registry_and_auth_explicit_legacy_hub

  • test_resolve_registry_and_auth_private_registry

  • test_resolve_registry_and_auth_unauthenticated_registry

  • test_resolve_auth_with_empty_credstore_and_auth_dict

Show
LoadConfigTest Go To Implementation

Methods

  • test_load_config_no_file

  • test_load_legacy_config

  • test_load_json_config

  • test_load_modern_json_config

  • test_load_config_with_random_name

  • test_load_config_custom_config_env

  • test_load_config_custom_config_env_with_auths

  • test_load_config_custom_config_env_utf8

  • test_load_config_unknown_keys

  • test_load_config_invalid_auth_dict

  • test_load_config_identity_token

Show
CredstoreTest Go To Implementation

Methods

  • setUp

  • test_get_credential_store

  • test_get_credential_store_no_default

  • test_get_credential_store_default_index

  • test_get_credential_store_with_plain_dict

  • test_get_all_credentials_credstore_only

  • test_get_all_credentials_with_empty_credhelper

  • test_get_all_credentials_with_credhelpers_only

  • test_get_all_credentials_with_auths_entries

  • test_get_all_credentials_with_empty_auths_entry

  • test_get_all_credentials_credstore_overrides_auth_entry

  • test_get_all_credentials_helpers_override_default

  • test_get_all_credentials_3_sources

Show
InMemoryStore Go To Implementation

Methods

  • get

  • store

  • list

  • erase

Show
BaseAPIClientTest Go To Implementation

Methods

  • setUp

  • tearDown

  • base_create_payload

Show
DockerApiTest Go To Implementation

Methods

  • test_ctor

  • test_url_valid_resource

  • test_url_invalid_resource

  • test_url_no_resource

  • test_url_unversioned_api

  • test_version

  • test_version_no_api_version

  • test_retrieve_server_version

  • test_auto_retrieve_server_version

  • test_info

  • test_search

  • test_login

  • test_events

  • test_events_with_since_until

  • test_events_with_filters

  • _socket_path_for_client_session

  • test_url_compatibility_unix

  • test_url_compatibility_unix_triple_slash

  • test_url_compatibility_http_unix_triple_slash

  • test_url_compatibility_http

  • test_url_compatibility_tcp

  • test_remove_link

  • test_create_host_config_secopt

  • test_stream_helper_decoding

Show
UnixSocketStreamTest Go To Implementation

Methods

  • setUp

  • stop

  • _setup_socket

  • run_server

  • early_response_sending_handler

  • test_early_stream_response

Show
TCPSocketStreamTest Go To Implementation

Methods

  • setup_class

  • teardown_class

  • get_handler_class

  • request

  • test_read_from_socket_tty

  • test_read_from_socket_tty_demux

  • test_read_from_socket_no_tty

  • test_read_from_socket_no_tty_demux

  • test_read_from_socket_no_stream_tty

  • test_read_from_socket_no_stream_tty_demux

  • test_read_from_socket_no_stream_no_tty

  • test_read_from_socket_no_stream_no_tty_demux

Show
UserAgentTest Go To Implementation

Methods

  • setUp

  • tearDown

  • test_default_user_agent

  • test_custom_user_agent

Show
DisableSocketTest Go To Implementation

Methods

  • setUp

  • test_disable_socket_timeout

  • test_disable_socket_timeout2

  • test_disable_socket_timout_non_blocking

Show
ContainerCollectionTest Go To Implementation

Methods

  • test_run

  • test_create_container_args

  • test_run_detach

  • test_run_pull

  • test_run_with_error

  • test_run_with_image_object

  • test_run_remove

  • test_run_platform

  • test_run_networking_config_without_network

  • test_run_networking_config_with_network_mode

  • test_run_networking_config

  • test_run_networking_config_with_undeclared_network

  • test_run_networking_config_only_undeclared_network

  • test_create

  • test_create_with_image_object

  • test_create_networking_config_without_network

  • test_create_networking_config_with_network_mode

  • test_create_networking_config

  • test_create_networking_config_with_undeclared_network

  • test_create_networking_config_only_undeclared_network

  • test_get

  • test_list

  • test_list_ignore_removed

Show
ContainerTest Go To Implementation

Methods

  • test_short_id

  • test_name

  • test_status

  • test_attach

  • test_commit

  • test_diff

  • test_exec_run

  • test_exec_run_failure

  • test_export

  • test_get_archive

  • test_image

  • test_kill

  • test_labels

  • test_logs

  • test_pause

  • test_put_archive

  • test_remove

  • test_rename

  • test_resize

  • test_restart

  • test_start

  • test_stats

  • test_stop

  • test_top

  • test_unpause

  • test_update

  • test_wait

Show
ExcludePathsTest Go To Implementation

Methods

  • setUp

  • tearDown

  • exclude

  • test_no_excludes

  • test_no_dupes

  • test_wildcard_exclude

  • test_exclude_dockerfile_dockerignore

  • test_exclude_custom_dockerfile

  • test_exclude_dockerfile_child

  • test_single_filename

  • test_single_filename_leading_dot_slash

  • test_single_filename_trailing_slash

  • test_wildcard_filename_start

  • test_wildcard_with_exception

  • test_wildcard_with_wildcard_exception

  • test_wildcard_filename_end

  • test_question_mark

  • test_single_subdir_single_filename

  • test_single_subdir_single_filename_leading_slash

  • test_exclude_include_absolute_path

  • test_single_subdir_with_path_traversal

  • test_single_subdir_wildcard_filename

  • test_wildcard_subdir_single_filename

  • test_wildcard_subdir_wildcard_filename

  • test_directory

  • test_directory_with_trailing_slash

  • test_directory_with_single_exception

  • test_directory_with_subdir_exception

  • test_directory_with_subdir_exception_win32_pathsep

  • test_directory_with_wildcard_exception

  • test_subdirectory

  • test_subdirectory_win32_pathsep

  • test_double_wildcard

  • test_single_and_double_wildcard

  • test_trailing_double_wildcard

  • test_double_wildcard_with_exception

  • test_include_wildcard

  • test_last_line_precedence

  • test_parent_directory

Show

Methods

  • test_tar_with_excludes

  • test_tar_with_empty_directory

  • test_tar_with_inaccessible_file

  • test_tar_with_file_symlinks

  • test_tar_with_directory_symlinks

  • test_tar_with_broken_symlinks

  • test_tar_socket_file

  • tar_test_negative_mtime_bug

  • test_tar_directory_link

Show
ContainerCollectionTest Go To Implementation

Methods

  • test_run

  • test_run_detach

  • test_run_with_error

  • test_run_with_image_that_does_not_exist

  • test_run_with_volume

  • test_run_with_named_volume

  • test_run_with_network

  • test_run_with_networking_config

  • test_run_with_networking_config_with_undeclared_network

  • test_run_with_networking_config_only_undeclared_network

  • test_run_with_none_driver

  • test_run_with_json_file_driver

  • test_run_with_auto_remove

  • test_run_with_auto_remove_error

  • test_run_with_streamed_logs

  • test_run_with_streamed_logs_and_cancel

  • test_run_with_proxy_config

  • test_get

  • test_list

  • test_list_sparse

Show
ContainerTest Go To Implementation

Methods

  • test_commit

  • test_diff

  • test_exec_run_success

  • test_exec_run_error_code_from_exec

  • test_exec_run_failed

  • test_kill

  • test_logs

  • test_pause

  • test_remove

  • test_rename

  • test_restart

  • test_start

  • test_stats

  • test_ports_target_none

  • test_ports_target_tuple

  • test_ports_target_list

  • test_stop

  • test_top

  • test_update

  • test_wait

  • test_create_with_volume_driver

Show

Local representation of a container object. Detailed configuration may

be accessed through the :py:attr:attrs attribute. Note that local

attributes are cached; users may call :py:meth:reload to

query the Docker daemon for the current properties, causing

:py:attr:attrs to be refreshed.

Methods

  • name

  • image

  • labels

  • status

  • health

  • ports

  • attach

  • attach_socket

  • commit

  • diff

  • exec_run

  • export

  • get_archive

  • kill

  • logs

  • pause

  • put_archive

  • remove

  • rename

  • resize

  • restart

  • start

  • stats

  • stop

  • top

  • unpause

  • update

  • wait

Show
ContainerCollection Go To Implementation

Methods

  • run

  • create

  • get

  • list

  • prune

Show
NpipeSocket Go To Implementation

Partial implementation of the socket API over windows named pipes.

This implementation is only designed to be used as a client socket,

and server-specific methods (bind, listen, accept…) are not

implemented.

Methods

  • accept

  • bind

  • close

  • connect

  • connect_ex

  • detach

  • dup

  • getpeername

  • getsockname

  • getsockopt

  • ioctl

  • listen

  • makefile

  • recv

  • recvfrom

  • recvfrom_into

  • recv_into

  • send

  • sendall

  • sendto

  • setblocking

  • settimeout

  • gettimeout

  • setsockopt

  • shutdown

Show
NpipeFileIOBase Go To Implementation

Methods

  • close

  • fileno

  • isatty

  • readable

  • readinto

  • seekable

  • writable

Show
TestNetworks Go To Implementation

Methods

  • tearDown

  • create_network

  • test_list_networks

  • test_inspect_network

  • test_create_network_with_ipam_config

  • test_create_network_with_host_driver_fails

  • test_remove_network

  • test_connect_and_disconnect_container

  • test_connect_and_force_disconnect_container

  • test_connect_with_aliases

  • test_connect_on_container_create

  • test_create_with_aliases

  • test_create_with_ipv4_address

  • test_create_with_ipv6_address

  • test_create_with_linklocal_ips

  • test_create_with_driveropt

  • test_create_with_links

  • test_create_check_duplicate

  • test_connect_with_links

  • test_connect_with_ipv4_address

  • test_connect_with_ipv6_address

  • test_connect_with_mac_address

  • test_create_internal_networks

  • test_create_network_with_labels

  • test_create_network_with_labels_wrong_type

  • test_create_network_ipv6_enabled

  • test_create_network_attachable

  • test_create_network_ingress

  • test_prune_networks

  • test_create_inspect_network_with_scope

  • test_create_remove_network_with_space_in_name

Show
ContainerApiMixin Go To Implementation

Methods

  • attach

  • attach_socket

  • commit

  • containers

  • create_container

  • create_container_config

  • create_container_from_config

  • create_host_config

  • create_networking_config

  • create_endpoint_config

  • diff

  • export

  • get_archive

  • inspect_container

  • kill

  • logs

  • pause

  • port

  • put_archive

  • prune_containers

  • remove_container

  • rename

  • resize

  • restart

  • start

  • stats

  • stop

  • top

  • unpause

  • update_container

  • wait

Show

A low-level client for the Docker Engine API.

Example:

import docker client = docker.APIClient(base_url=’unix://var/run/docker.sock’) client.version() {u’ApiVersion’: u’1.33’, u’Arch’: u’amd64’, u’BuildTime’: u’2017-11-19T18:46:37.000000000+00:00’, u’GitCommit’: u’f4ffd2511c’, u’GoVersion’: u’go1.9.2’, u’KernelVersion’: u’4.14.3-1-ARCH’, u’MinAPIVersion’: u’1.12’, u’Os’: u’linux’, u’Version’: u’17.10.0-ce’}

Args: base_url (str): URL to the Docker server. For example, unix:///var/run/docker.sock or tcp://127.0.0.1:1234. version (str): The version of the API to use. Set to auto to automatically detect the server’s version. Default: 1.35 timeout (int): Default timeout for API calls, in seconds. tls (bool or :py:class:~docker.tls.TLSConfig): Enable TLS. Pass True to enable it with default options, or pass a :py:class:~docker.tls.TLSConfig object to use custom configuration. user_agent (str): Set a custom user agent for requests to the server. credstore_env (dict): Override environment variables when calling the credential store process. use_ssh_client (bool): If set to True, an ssh connection is made via shelling out to the ssh client. Ensure the ssh client is installed and configured on the host. max_pool_size (int): The maximum number of connections to save in the pool.

Methods

  • _retrieve_server_version

  • _set_request_timeout

  • _post

  • _get

  • _put

  • _delete

  • _url

  • _raise_for_status

  • _result

  • _post_json

  • _attach_params

  • _attach_websocket

  • _create_websocket_connection

  • _get_raw_response_socket

  • _stream_helper

  • _multiplexed_buffer_helper

  • _multiplexed_response_stream_helper

  • _stream_raw_result

  • _read_from_socket

  • _disable_socket_timeout

  • _check_is_tty

  • _get_result

  • _get_result_tty

  • _unmount

  • get_adapter

  • api_version

  • reload_config

Show

Methods

  • test_image_viz

  • test_images

  • test_images_name

  • test_images_quiet

  • test_image_ids

  • test_images_filters

  • test_pull

  • test_pull_stream

  • test_commit

  • test_remove_image

  • test_image_history

  • test_import_image

  • test_import_image_from_bytes

  • test_import_image_from_image

  • test_inspect_image

  • test_inspect_image_undefined_id

  • test_push_image

  • test_push_image_with_tag

  • test_push_image_with_auth

  • test_push_image_stream

  • test_tag_image

  • test_tag_image_tag

  • test_tag_image_force

  • test_get_image

  • test_load_image

  • test_load_image_quiet

Show

Methods

  • test_build_with_proxy

  • test_build_with_proxy_and_buildargs

  • test_build_streaming

  • test_build_from_stringio

  • test_build_with_dockerignore

  • test_build_with_buildargs

  • test_build_shmsize

  • test_build_isolation

  • test_build_labels

  • test_build_with_cache_from

  • test_build_container_with_target

  • test_build_with_network_mode

  • test_build_with_extra_hosts

  • test_build_squash

  • test_build_stderr_data

  • test_build_gzip_encoding

  • test_build_with_dockerfile_empty_lines

  • test_build_gzip_custom_encoding

  • test_build_invalid_platform

  • test_build_out_of_context_dockerfile

  • test_build_in_context_dockerfile

  • test_build_in_context_nested_dockerfile

  • test_build_in_context_abs_dockerfile

  • test_prune_builds

Show

Methods

  • test_build_with_proxy

  • test_build_with_proxy_and_buildargs

  • test_build_streaming

  • test_build_from_stringio

  • test_build_with_dockerignore

  • test_build_with_buildargs

  • test_build_shmsize

  • test_build_isolation

  • test_build_labels

  • test_build_with_cache_from

  • test_build_container_with_target

  • test_build_with_network_mode

  • test_build_with_extra_hosts

  • test_build_squash

  • test_build_stderr_data

  • test_build_gzip_encoding

  • test_build_with_dockerfile_empty_lines

  • test_build_gzip_custom_encoding

  • test_build_invalid_platform

  • test_build_out_of_context_dockerfile

  • test_build_in_context_dockerfile

  • test_build_in_context_nested_dockerfile

  • test_build_in_context_abs_dockerfile

  • test_prune_builds

Show

An image on the server.

Methods

  • labels

  • short_id

  • tags

  • history

  • remove

  • save

  • tag

Show
RegistryData Go To Implementation

Image metadata stored on the registry, including available platforms.

Methods

  • id

  • short_id

  • pull

  • has_platform

  • reload

Show
ImageCollection Go To Implementation

Methods

  • build

  • get

  • get_registry_data

  • list

  • load

  • pull

  • push

  • remove

  • search

  • prune

  • prune_builds

Show

Methods

  • test_execute_command_with_proxy_env

  • test_execute_command

  • test_exec_command_string

  • test_exec_command_as_user

  • test_exec_command_as_root

  • test_exec_command_streaming

  • test_exec_start_socket

  • test_exec_start_detached

  • test_exec_inspect

  • test_exec_command_with_env

  • test_exec_command_with_workdir

  • test_detach_with_default

  • test_detach_with_config_file

Show
ExecDemuxTest Go To Implementation

Methods

  • setUp

  • test_exec_command_no_stream_no_demux

  • test_exec_command_stream_no_demux

  • test_exec_command_no_stream_demux

  • test_exec_command_stream_demux

  • test_exec_command_tty_no_stream_no_demux

  • test_exec_command_tty_stream_no_demux

  • test_exec_command_tty_no_stream_demux

  • test_exec_command_tty_stream_demux

Show

Methods

  • setUp

  • tearDown

  • test_init_swarm_simple

  • test_init_swarm_force_new_cluster

  • test_init_swarm_custom_addr_pool_defaults

  • test_init_swarm_custom_addr_pool_only_pool

  • test_init_swarm_custom_addr_pool_only_subnet_size

  • test_init_swarm_custom_addr_pool_both_args

  • test_init_already_in_cluster

  • test_init_swarm_custom_raft_spec

  • test_init_swarm_with_ca_config

  • test_init_swarm_with_autolock_managers

  • test_init_swarm_with_log_driver

  • test_leave_swarm

  • test_update_swarm

  • test_list_nodes

  • test_inspect_node

  • test_update_node

  • test_remove_main_node

  • test_rotate_manager_unlock_key

  • test_init_swarm_data_path_addr

  • test_init_swarm_data_path_port

Show
LogConfigTypesEnum Go To Implementation
Show

Configure logging for a container, when provided as an argument to :py:meth:~docker.api.container.ContainerApiMixin.create_host_config. You may refer to the official logging driver documentation <https://docs.docker.com/config/containers/logging/configure/>_ for more information.

Args: type (str): Indicate which log driver to use. A set of valid drivers is provided as part of the :py:attr:LogConfig.types enum. Other values may be accepted depending on the engine version and available logging plugins. config (dict): A driver-dependent configuration dictionary. Please refer to the driver’s documentation for a list of valid config keys.

Example:

from docker.types import LogConfig lc = LogConfig(type=LogConfig.types.JSON, config={ … ‘max-size’: ‘1g’, … ‘labels’: ‘production_status,geo’ … })

hc = client.create_host_config(log_config=lc) container = client.create_container(‘busybox’, ‘true’, … host_config=hc)

client.inspect_container(container)[‘HostConfig’][‘LogConfig’] { ‘Type’: ‘json-file’, ‘Config’: {‘labels’: ‘production_status,geo’, ‘max-size’: ‘1g’} }

Methods

  • type

  • type

  • config

  • set_config_value

  • unset_config

Show

Create a ulimit declaration to be used with :py:meth:~docker.api.container.ContainerApiMixin.create_host_config.

Args:

name (str): Which ulimit will this apply to. The valid names can be found in ‘/etc/security/limits.conf’ on a gnu/linux system. soft (int): The soft limit for this ulimit. Optional. hard (int): The hard limit for this ulimit. Optional.

Example:

nproc_limit = docker.types.Ulimit(name=’nproc’, soft=1024) hc = client.create_host_config(ulimits=[nproc_limit]) container = client.create_container( ‘busybox’, ‘true’, host_config=hc )

client.inspect_container(container)[‘HostConfig’][‘Ulimits’] [{‘Name’: ‘nproc’, ‘Hard’: 0, ‘Soft’: 1024}]

Methods

  • name

  • name

  • soft

  • soft

  • hard

  • hard

Show
DeviceRequest Go To Implementation

Create a device request to be used with :py:meth:~docker.api.container.ContainerApiMixin.create_host_config.

Args:

driver (str): Which driver to use for this device. Optional. count (int): Number or devices to request. Optional. Set to -1 to request all available devices. device_ids (list): List of strings for device IDs. Optional. Set either count or device_ids. capabilities (list): List of lists of strings to request capabilities. Optional. The global list acts like an OR, and the sub-lists are AND. The driver will try to satisfy one of the sub-lists. Available capabilities for the nvidia driver can be found here <https://github.com/NVIDIA/nvidia-container-runtime>_. options (dict): Driver-specific options. Optional.

Methods

  • driver

  • driver

  • count

  • count

  • device_ids

  • device_ids

  • capabilities

  • capabilities

  • options

  • options

Show
Show
ContainerConfig Go To Implementation
Show

Methods

  • test_events

  • test_info

  • test_ping

  • test_version

  • test_call_api_client_method

  • test_call_containers

  • test_default_pool_size_unix

  • test_default_pool_size_win

  • test_pool_size_unix

  • test_pool_size_win

Show
FromEnvTest Go To Implementation

Methods

  • setUp

  • tearDown

  • test_from_env

  • test_from_env_with_version

  • test_from_env_without_version_uses_default

  • test_from_env_without_timeout_uses_default

  • test_default_pool_size_from_env_unix

  • test_default_pool_size_from_env_win

  • test_pool_size_from_env_unix

  • test_pool_size_from_env_win

Show
ServiceTest Go To Implementation

Methods

  • setUpClass

  • tearDownClass

  • test_create

  • test_create_with_network

  • test_get

  • test_list_remove

  • test_tasks

  • test_update

  • test_update_retains_service_labels

  • test_update_retains_container_labels

  • test_update_remove_service_labels

  • test_update_retains_networks

  • test_scale_service

  • test_scale_method_service

  • test_scale_method_global_service

  • test_force_update_service

  • test_force_update_service_using_bool

  • test_force_update_service_using_shorthand_method

  • test_create_cap_add

  • test_create_cap_drop

Show
ListImagesTest Go To Implementation

Methods

  • test_images

  • test_images_quiet

Show
PullImageTest Go To Implementation

Methods

  • test_pull

  • test_pull_streaming

  • test_pull_invalid_platform

Show

Methods

  • test_commit

  • test_commit_with_changes

Show
RemoveImageTest Go To Implementation

Methods

  • test_remove

Show
ImportImageTest Go To Implementation

Methods

  • write_dummy_tar_content

  • dummy_tar_stream

  • dummy_tar_file

  • test_import_from_bytes

  • test_import_from_file

  • test_import_from_stream

  • test_import_image_from_data_with_changes

  • test_import_image_with_changes

  • test_get_load_image

  • temporary_http_file_server

  • test_import_from_url

Show
SaveLoadImagesTest Go To Implementation

Methods

  • test_get_image_load_image

Show
ImageCollectionTest Go To Implementation

Methods

  • test_build

  • test_get

  • test_labels

  • test_list

  • test_load

  • test_pull

  • test_pull_tag_precedence

  • test_pull_multiple

  • test_pull_with_stream_param

  • test_push

  • test_remove

  • test_search

  • test_search_limit

Show

Methods

  • test_short_id

  • test_tags

  • test_history

  • test_remove

  • test_save

  • test_tag

Show
APIErrorTest Go To Implementation

Methods

  • test_api_error_is_caught_by_dockerexception

  • test_status_code_200

  • test_status_code_400

  • test_status_code_500

  • test_is_server_error_200

  • test_is_server_error_300

  • test_is_server_error_400

  • test_is_server_error_500

  • test_is_client_error_500

  • test_is_client_error_400

  • test_is_error_300

  • test_is_error_400

  • test_is_error_500

  • test_create_error_from_exception

Show
ContainerErrorTest Go To Implementation

Methods

  • test_container_without_stderr

  • test_container_with_stderr

Show
CreateUnexpectedKwargsErrorTest Go To Implementation

Methods

  • test_create_unexpected_kwargs_error_single

  • test_create_unexpected_kwargs_error_multiple

Show
DockerClient Go To Implementation

A client for communicating with a Docker server.

Example:

import docker client = docker.DockerClient(base_url=’unix://var/run/docker.sock’)

Args: base_url (str): URL to the Docker server. For example, unix:///var/run/docker.sock or tcp://127.0.0.1:1234. version (str): The version of the API to use. Set to auto to automatically detect the server’s version. Default: 1.35 timeout (int): Default timeout for API calls, in seconds. tls (bool or :py:class:~docker.tls.TLSConfig): Enable TLS. Pass True to enable it with default options, or pass a :py:class:~docker.tls.TLSConfig object to use custom configuration. user_agent (str): Set a custom user agent for requests to the server. credstore_env (dict): Override environment variables when calling the credential store process. use_ssh_client (bool): If set to True, an ssh connection is made via shelling out to the ssh client. Ensure the ssh client is installed and configured on the host. max_pool_size (int): The maximum number of connections to save in the pool.

Methods

  • from_env

  • configs

  • containers

  • images

  • networks

  • nodes

  • plugins

  • secrets

  • services

  • swarm

  • volumes

  • events

  • df

  • info

  • login

  • ping

  • version

  • close

Show
ImageApiMixin Go To Implementation

Methods

  • get_image

  • history

  • images

  • import_image

  • import_image_from_data

  • import_image_from_file

  • import_image_from_stream

  • import_image_from_url

  • import_image_from_image

  • inspect_image

  • inspect_distribution

  • load_image

  • prune_images

  • pull

  • push

  • remove_image

  • search

  • tag

Show
ImageCollectionTest Go To Implementation

Methods

  • test_build

  • test_build_with_error

  • test_build_with_multiple_success

  • test_build_with_success_build_output

  • test_list

  • test_list_with_repository

  • test_pull

  • test_pull_with_tag

  • test_pull_with_sha

  • test_pull_multiple

  • test_load_error

  • test_save_and_load

  • test_save_and_load_repo_name

  • test_save_name_error

Show

Methods

  • test_tag_and_remove

Show

A context.

Methods

  • set_endpoint

  • inspect

  • load_context

  • _load_meta

  • _load_certs

  • save

  • remove

  • is_docker_host

  • Name

  • Host

  • Orchestrator

  • Metadata

  • TLSConfig

  • TLSMaterial

  • Storage

Show

Methods

  • test_build_container

  • test_build_container_pull

  • test_build_container_custom_context

  • test_build_container_custom_context_gzip

  • test_build_remote_with_registry_auth

  • test_build_container_with_named_dockerfile

  • test_build_with_invalid_tag

  • test_build_container_with_container_limits

  • test_build_container_invalid_container_limits

  • test_set_auth_headers_with_empty_dict_and_auth_configs

  • test_set_auth_headers_with_dict_and_auth_configs

  • test_set_auth_headers_with_dict_and_no_auth_configs

  • test_process_dockerfile_win_longpath_prefix

  • test_process_dockerfile

Show

Methods

  • connect

  • _write

  • sendall

  • send

  • recv

  • makefile

  • close

Show
SSHConnection Go To Implementation

Methods

  • connect

Show
SSHConnectionPool Go To Implementation

Methods

  • _new_conn

  • _get_conn

Show
SSHHTTPAdapter Go To Implementation

Methods

  • _create_paramiko_client

  • _connect

  • get_connection

  • close

Show

A plugin on the server.

Methods

  • name

  • enabled

  • settings

  • configure

  • disable

  • enable

  • push

  • remove

  • upgrade

Show
PluginCollection Go To Implementation

Methods

  • create

  • get

  • install

  • list

Show

Methods

  • parse_auth

  • load_config

  • auths

  • creds_store

  • cred_helpers

  • is_empty

  • resolve_authconfig

  • _resolve_authconfig_credstore

  • _get_store_instance

  • get_credential_store

  • get_all_credentials

  • add_auth

Show
SwarmApiMixin Go To Implementation

Methods

  • create_swarm_spec

  • get_unlock_key

  • init_swarm

  • inspect_swarm

  • inspect_node

  • join_swarm

  • leave_swarm

  • nodes

  • remove_node

  • unlock_swarm

  • update_node

  • update_swarm

Show
FindConfigFileTest Go To Implementation

Methods

  • tmpdir

  • test_find_config_fallback

  • test_find_config_from_explicit_path

  • test_find_config_from_environment

  • test_find_config_from_home_posix

  • test_find_config_from_home_legacy_name

  • test_find_config_from_home_windows

Show
LoadConfigTest Go To Implementation

Methods

  • test_load_config_no_file

  • test_load_config_custom_headers

  • test_load_config_detach_keys

  • test_load_config_from_env

Show

A service.

Methods

  • name

  • version

  • remove

  • tasks

  • update

  • logs

  • scale

  • force_update

Show
ServiceCollection Go To Implementation

Services on the Docker server.

Methods

  • create

  • get

  • list

Show
PluginApiMixin Go To Implementation

Methods

  • configure_plugin

  • create_plugin

  • disable_plugin

  • enable_plugin

  • inspect_plugin

  • pull_plugin

  • plugins

  • plugin_privileges

  • push_plugin

  • remove_plugin

  • upgrade_plugin

Show

Methods

  • test_list_volumes

  • test_list_volumes_and_filters

  • test_create_volume

  • test_create_volume_with_labels

  • test_create_volume_with_invalid_labels

  • test_create_volume_with_driver

  • test_create_volume_invalid_opts_type

  • test_create_volume_with_no_specified_name

  • test_inspect_volume

  • test_remove_volume

Show
BaseIntegrationTest Go To Implementation

A base class for integration test cases. It cleans up the Docker server

after itself.

Methods

  • setUp

  • tearDown

Show
BaseAPIIntegrationTest Go To Implementation

A test case for APIClient integration tests. It sets up an APIClient

as self.client.

Methods

  • setUp

  • tearDown

  • get_client_instance

  • _init_swarm

  • run_container

  • create_and_start

  • execute

  • init_swarm

Show

Methods

  • teardown_method

  • setup_method

  • get_random_servername

  • test_store_and_get

  • test_get_nonexistent

  • test_store_and_erase

  • test_unicode_strings

  • test_list

  • test_execute_with_env_override

  • test_unavailable_store

Show
Healthcheck Go To Implementation

Defines a healthcheck configuration for a container or service.

Args: test (:py:class:list or str): Test to perform to determine container health. Possible values:

  • Empty list: Inherit healthcheck from parent image
  • ["NONE"]: Disable healthcheck
  • ["CMD", args...]: exec arguments directly.
  • ["CMD-SHELL", command]: Run command in the system’s default shell.

If a string is provided, it will be used as a CMD-SHELL command. interval (int): The time to wait between checks in nanoseconds. It should be 0 or at least 1000000 (1 ms). timeout (int): The time to wait before considering the check to have hung. It should be 0 or at least 1000000 (1 ms). retries (int): The number of consecutive failures needed to consider a container as unhealthy. start_period (int): Start period for the container to initialize before starting health-retries countdown in nanoseconds. It should be 0 or at least 1000000 (1 ms).

Methods

  • test

  • test

  • interval

  • interval

  • timeout

  • timeout

  • retries

  • retries

  • start_period

  • start_period

Show
TestVolumes Go To Implementation

Methods

  • test_create_volume

  • test_create_volume_invalid_driver

  • test_list_volumes

  • test_inspect_volume

  • test_inspect_nonexistent_volume

  • test_remove_volume

  • test_force_remove_volume

  • test_prune_volumes

  • test_remove_nonexistent_volume

Show

A Docker network.

Methods

  • name

  • containers

  • connect

  • disconnect

  • remove

Show
NetworkCollection Go To Implementation

Networks on the Docker server.

Methods

  • create

  • get

  • list

  • prune

Show

The server’s Swarm state. This a singleton that must be reloaded to get

the current state of the Swarm.

Methods

  • version

  • get_unlock_key

  • init

  • join

  • leave

  • reload

  • unlock

  • update

Show
ServiceApiMixin Go To Implementation

Methods

  • create_service

  • inspect_service

  • inspect_task

  • remove_service

  • services

  • service_logs

  • tasks

  • update_service

Show
TestJsonSplitter Go To Implementation

Methods

  • test_json_splitter_no_object

  • test_json_splitter_with_object

  • test_json_splitter_leading_whitespace

Show
TestStreamAsText Go To Implementation

Methods

  • test_stream_with_non_utf_unicode_character

  • test_stream_with_utf_character

Show
TestJsonStream Go To Implementation

Methods

  • test_with_falsy_entries

  • test_with_leading_whitespace

Show
BaseContextTest Go To Implementation

Methods

  • test_url_compatibility_on_linux

  • test_url_compatibility_on_windows

  • test_fail_on_default_context_create

  • test_default_in_context_list

  • test_get_current_context

  • test_https_host

  • test_context_inspect_without_params

Show
ProxyConfig Go To Implementation

Methods

  • http

  • https

  • ftp

  • no_proxy

  • from_dict

  • get_environment

  • inject_proxy_environment

Show

A base class for representing a single object on the server.

Methods

  • id

  • short_id

  • reload

Show

A base class for representing all objects of a particular type on the

server.

Methods

  • list

  • get

  • create

  • prepare_model

Show

Context API.

Contains methods for context management:

create, list, remove, get, inspect.

Methods

  • create_context

  • get_context

  • contexts

  • get_current_context

  • set_current_context

  • remove_context

  • inspect_context

Show
NetworkApiMixin Go To Implementation

Methods

  • networks

  • create_network

  • prune_networks

  • remove_network

  • inspect_network

  • connect_container_to_network

  • disconnect_container_from_network

Show
TaskTemplate Go To Implementation

Describe the task specification to be used when creating or updating a service.

Args:

container_spec (ContainerSpec): Container settings for containers started as part of this task. log_driver (DriverConfig): Log configuration for containers created as part of the service. resources (Resources): Resource requirements which apply to each individual container created as part of the service. restart_policy (RestartPolicy): Specification for the restart policy which applies to containers created as part of this service. placement (Placement): Placement instructions for the scheduler. If a list is passed instead, it is assumed to be a list of constraints as part of a :py:class:Placement object. networks (:py:class:list): List of network names or IDs or :py:class:NetworkAttachmentConfig to attach the service to. force_update (int): A counter that triggers an update even if no relevant parameters have been changed.

Methods

  • container_spec

  • resources

  • restart_policy

  • placement

Show
ContainerSpec Go To Implementation

Describes the behavior of containers that are part of a task, and is used when declaring a :py:class:~docker.types.TaskTemplate.

Args:

image (string): The image name to use for the container. command (string or list): The command to be run in the image. args (:py:class:list): Arguments to the command. hostname (string): The hostname to set on the container. env (dict): Environment variables. workdir (string): The working directory for commands to run in. user (string): The user inside the container. labels (dict): A map of labels to associate with the service. mounts (:py:class:list): A list of specifications for mounts to be added to containers created as part of the service. See the :py:class:~docker.types.Mount class for details. stop_grace_period (int): Amount of time to wait for the container to terminate before forcefully killing it. secrets (:py:class:list): List of :py:class:SecretReference to be made available inside the containers. tty (boolean): Whether a pseudo-TTY should be allocated. groups (:py:class:list): A list of additional groups that the container process will run as. open_stdin (boolean): Open stdin read_only (boolean): Mount the container’s root filesystem as read only. stop_signal (string): Set signal to stop the service’s containers healthcheck (Healthcheck): Healthcheck configuration for this service. hosts (:py:class:dict): A set of host to IP mappings to add to the container’s hosts file. dns_config (DNSConfig): Specification for DNS related configurations in resolver configuration file. configs (:py:class:list): List of :py:class:ConfigReference that will be exposed to the service. privileges (Privileges): Security options for the service’s containers. isolation (string): Isolation technology used by the service’s containers. Only used for Windows containers. init (boolean): Run an init inside the container that forwards signals and reaps processes. cap_add (:py:class:list): A list of kernel capabilities to add to the default set for the container. cap_drop (:py:class:list): A list of kernel capabilities to drop from the default set for the container. sysctls (:py:class:dict): A dict of sysctl values to add to the container

Show

Describes a mounted folder’s configuration inside a container. A list of :py:class:Mount would be used as part of a :py:class:~docker.types.ContainerSpec.

Args:

target (string): Container path. source (string): Mount source (e.g. a volume name or a host path). type (string): The mount type (bind / volume / tmpfs / npipe). Default: volume. read_only (bool): Whether the mount should be read-only. consistency (string): The consistency requirement for the mount. One of default```, consistent, cached, delegated. propagation (string): A propagation mode with the value [r]private, [r]shared, or [r]slave. Only valid for the bindtype. no_copy (bool): False if the volume should be populated with the data from the target. Default:False. Only valid for the volumetype. labels (dict): User-defined name and labels for the volume. Only valid for thevolumetype. driver_config (DriverConfig): Volume driver configuration. Only valid for thevolume“ type. tmpfs_size (int or string): The size for the tmpfs mount in bytes. tmpfs_mode (int): The permission mode for the tmpfs mount.

Methods

  • parse_mount_string

Show

Configures resource allocation for containers when made part of a :py:class:~docker.types.ContainerSpec.

Args:

cpu_limit (int): CPU limit in units of 10^9 CPU shares. mem_limit (int): Memory limit in Bytes. cpu_reservation (int): CPU reservation in units of 10^9 CPU shares. mem_reservation (int): Memory reservation in Bytes. generic_resources (dict or :py:class:list): Node level generic resources, for example a GPU, using the following format: { resource_name: resource_value }. Alternatively, a list of of resource specifications as defined by the Engine API.

Show
UpdateConfig Go To Implementation

Used to specify the way container updates should be performed by a service.

Args:

parallelism (int): Maximum number of tasks to be updated in one iteration (0 means unlimited parallelism). Default: 0. delay (int): Amount of time between updates, in nanoseconds. failure_action (string): Action to take if an updated task fails to run, or stops running during the update. Acceptable values are continue, pause, as well as rollback since API v1.28. Default: continue monitor (int): Amount of time to monitor each updated task for failures, in nanoseconds. max_failure_ratio (float): The fraction of tasks that may fail during an update before the failure action is invoked, specified as a floating point number between 0 and 1. Default: 0 order (string): Specifies the order of operations when rolling out an updated task. Either start-first or stop-first are accepted.

Show
RollbackConfig Go To Implementation

Used to specify the way container rollbacks should be performed by a service

Args: parallelism (int): Maximum number of tasks to be rolled back in one iteration (0 means unlimited parallelism). Default: 0 delay (int): Amount of time between rollbacks, in nanoseconds. failure_action (string): Action to take if a rolled back task fails to run, or stops running during the rollback. Acceptable values are continue, pause or rollback. Default: continue monitor (int): Amount of time to monitor each rolled back task for failures, in nanoseconds. max_failure_ratio (float): The fraction of tasks that may fail during a rollback before the failure action is invoked, specified as a floating point number between 0 and 1. Default: 0 order (string): Specifies the order of operations when rolling out a rolled back task. Either start-first or stop-first are accepted.

Show
RestartConditionTypesEnum Go To Implementation
Show
RestartPolicy Go To Implementation

Used when creating a :py:class:~docker.types.ContainerSpec, dictates whether a container should restart after stopping or failing.

Args:

condition (string): Condition for restart (none, on-failure, or any). Default: none. delay (int): Delay between restart attempts. Default: 0 max_attempts (int): Maximum attempts to restart a given container before giving up. Default value is 0, which is ignored. window (int): Time window used to evaluate the restart policy. Default value is 0, which is unbounded.

Show
DriverConfig Go To Implementation

Indicates which driver to use, as well as its configuration. Can be used as log_driver in a :py:class:~docker.types.ContainerSpec, for the driver_config in a volume :py:class:~docker.types.Mount, or as the driver object in :py:meth:create_secret.

Args:

name (string): Name of the driver to use. options (dict): Driver-specific options. Default: None.

Show
EndpointSpec Go To Implementation

Describes properties to access and load-balance a service.

Args:

mode (string): The mode of resolution to use for internal load balancing between tasks ('vip' or 'dnsrr'). Defaults to 'vip' if not provided. ports (dict): Exposed ports that this service is accessible on from the outside, in the form of { published_port: target_port } or { published_port: <port_config_tuple> }. Port config tuple format is (target_port [, protocol [, publish_mode]]). Ports can only be provided if the vip resolution mode is used.

Show
ServiceMode Go To Implementation

Indicate whether a service or a job should be deployed as a replicated or global service, and associated parameters

Args: mode (string): Can be either replicated, global, replicated-job or global-job replicas (int): Number of replicas. For replicated services only. concurrency (int): Number of concurrent jobs. For replicated job services only.

Methods

  • _convert_mode

  • replicas

Show
SecretReference Go To Implementation

Secret reference to be used as part of a :py:class:ContainerSpec. Describes how a secret is made accessible inside the service’s containers.

Args: secret_id (string): Secret’s ID secret_name (string): Secret’s name as defined at its creation. filename (string): Name of the file containing the secret. Defaults to the secret’s name if not specified. uid (string): UID of the secret file’s owner. Default: 0 gid (string): GID of the secret file’s group. Default: 0 mode (int): File access mode inside the container. Default: 0o444

Show
ConfigReference Go To Implementation

Config reference to be used as part of a :py:class:ContainerSpec. Describes how a config is made accessible inside the service’s containers.

Args: config_id (string): Config’s ID config_name (string): Config’s name as defined at its creation. filename (string): Name of the file containing the config. Defaults to the config’s name if not specified. uid (string): UID of the config file’s owner. Default: 0 gid (string): GID of the config file’s group. Default: 0 mode (int): File access mode inside the container. Default: 0o444

Show

Placement constraints to be used as part of a :py:class:TaskTemplate

Args: constraints (:py:class:list of str): A list of constraints preferences (:py:class:list of tuple): Preferences provide a way to make the scheduler aware of factors such as topology. They are provided in order from highest to lowest precedence and are expressed as (strategy, descriptor) tuples. See :py:class:PlacementPreference for details. maxreplicas (int): Maximum number of replicas per node platforms (:py:class:list of tuple): A list of platforms expressed as (arch, os) tuples

Show
PlacementPreference Go To Implementation

Placement preference to be used as an element in the list of preferences for :py:class:Placement objects.

Args: strategy (string): The placement strategy to implement. Currently, the only supported strategy is spread. descriptor (string): A label descriptor. For the spread strategy, the scheduler will try to spread tasks evenly over groups of nodes identified by this label.

Show

Specification for DNS related configurations in resolver configuration file (resolv.conf). Part of a :py:class:ContainerSpec definition.

Args: nameservers (:py:class:list): The IP addresses of the name servers. search (:py:class:list): A search list for host-name lookup. options (:py:class:list): A list of internal resolver variables to be modified (e.g., debug, ndots:3, etc.).

Show
Show
NetworkAttachmentConfig Go To Implementation

Network attachment options for a service.

Args: target (str): The target network for attachment. Can be a network name or ID. aliases (:py:class:list): A list of discoverable alternate names for the service. options (:py:class:dict): Driver attachment options for the network target.

Show
NetworkTest Go To Implementation

Methods

  • test_list_networks

  • test_create_network

  • test_remove_network

  • test_inspect_network

  • test_connect_container_to_network

  • test_disconnect_container_from_network

Show
NetworkCollectionTest Go To Implementation

Methods

  • test_create

  • test_get

  • test_list

Show
NetworkTest Go To Implementation

Methods

  • test_connect

  • test_disconnect

  • test_remove

Show
InformationTest Go To Implementation

Methods

  • test_version

  • test_info

Show
AutoDetectVersionTest Go To Implementation

Methods

  • test_client_init

Show
ConnectionTimeoutTest Go To Implementation

Methods

  • setUp

  • test_timeout

Show
UnixconnTest Go To Implementation

Test UNIX socket connection adapter.

Methods

  • test_resource_warnings

Show
TestRegressions Go To Implementation

Methods

  • test_443_handle_nonchunked_response_in_stream

  • test_542_truncate_ids_client_side

  • test_647_support_doubleslash_in_image_names

  • test_649_handle_timeout_value_none

  • test_715_handle_user_param_as_int_value

  • test_792_explicit_port_protocol

Show

A volume.

Methods

  • name

  • remove

Show
VolumeCollection Go To Implementation

Volumes on the Docker server.

Methods

  • create

  • get

  • list

  • prune

Show
DaemonApiMixin Go To Implementation

Methods

  • df

  • events

  • info

  • login

  • ping

  • version

Show
SSHAdapterTest Go To Implementation

Methods

  • test_ssh_hostname_prefix_trim

  • test_ssh_parse_url

  • test_ssh_parse_hostname_only

  • test_ssh_parse_user_and_hostname

  • test_ssh_parse_hostname_and_port

Show

Methods

  • test_exec_create

  • test_exec_start

  • test_exec_start_detached

  • test_exec_inspect

  • test_exec_resize

Show
ProxyConfigTest Go To Implementation

Methods

  • test_from_dict

  • test_new

  • test_truthiness

  • test_environment

  • test_inject_proxy_environment

Show

Methods

  • test_info

  • test_ping

  • test_version

  • test_df

Show
CancellableEventsTest Go To Implementation

Methods

  • test_cancel_events

Show

A secret.

Methods

  • name

  • remove

Show
SecretCollection Go To Implementation

Secrets on the Docker server.

Methods

  • create

  • get

  • list

Show

A node in a swarm.

Methods

  • version

  • update

  • remove

Show
NodeCollection Go To Implementation

Nodes on the Docker server.

Methods

  • get

  • list

Show

A config.

Methods

  • name

  • remove

Show
ConfigCollection Go To Implementation

Configs on the Docker server.

Methods

  • create

  • get

  • list

Show
VolumeApiMixin Go To Implementation

Methods

  • volumes

  • create_volume

  • inspect_volume

  • prune_volumes

  • remove_volume

Show

Methods

  • get

  • store

  • erase

  • list

  • _execute

Show
NpipeHTTPConnection Go To Implementation

Methods

  • connect

Show
NpipeHTTPConnectionPool Go To Implementation

Methods

  • _new_conn

  • _get_conn

Show
NpipeHTTPAdapter Go To Implementation

Methods

  • get_connection

  • request_url

Show

Methods

  • setUp

  • tearDown

  • test_init_update_leave

  • test_join_on_already_joined_swarm

Show
NetworkCollectionTest Go To Implementation

Methods

  • test_create

  • test_get

  • test_list_remove

Show
NetworkTest Go To Implementation

Methods

  • test_connect_disconnect

Show
HealthcheckTest Go To Implementation

Methods

  • test_healthcheck_shell_command

  • test_healthcheck_passes

  • test_healthcheck_fails

  • test_healthcheck_start_period

Show
DockerException Go To Implementation

A base class from which all other exceptions inherit.

If you want to catch all errors that the Docker SDK might raise, catch this base exception.

Show

An HTTP error from the API.

Methods

  • status_code

  • is_error

  • is_client_error

  • is_server_error

Show
Show
ImageNotFound Go To Implementation
Show
InvalidVersion Go To Implementation
Show
InvalidRepository Go To Implementation
Show
InvalidConfigFile Go To Implementation
Show
InvalidArgument Go To Implementation
Show
DeprecatedMethod Go To Implementation
Show
TLSParameterError Go To Implementation
Show
NullResource Go To Implementation
Show
ContainerError Go To Implementation

Represents a container that has exited with a non-zero exit code.

Show
StreamParseError Go To Implementation
Show
Show
ImageLoadError Go To Implementation
Show
MissingContextParameter Go To Implementation
Show
ContextAlreadyExists Go To Implementation
Show
ContextException Go To Implementation
Show
ContextNotFound Go To Implementation
Show
PatternMatcher Go To Implementation

Methods

  • matches

  • walk

Show

Methods

  • normalize

  • match

Show
ConfigApiMixin Go To Implementation

Methods

  • create_config

  • inspect_config

  • remove_config

  • configs

Show
SecretApiMixin Go To Implementation

Methods

  • create_secret

  • inspect_secret

  • remove_secret

  • secrets

Show
ExecApiMixin Go To Implementation

Methods

  • exec_create

  • exec_inspect

  • exec_resize

  • exec_start

Show
UnixHTTPConnection Go To Implementation

Methods

  • connect

Show
UnixHTTPConnectionPool Go To Implementation

Methods

  • _new_conn

Show
UnixHTTPAdapter Go To Implementation

Methods

  • get_connection

  • request_url

Show

Methods

  • parse

  • major_minor

  • order

Show

Methods

  • test_node_update

  • test_join_swarm

  • test_join_swarm_no_listen_address_takes_default

Show

Methods

  • setUp

  • tearDown

  • test_list_get_update

Show
ContextLifecycleTest Go To Implementation

Methods

  • test_lifecycle

  • test_context_remove

  • test_load_context_without_orchestrator

Show
BuildApiMixin Go To Implementation

Methods

  • build

  • prune_builds

  • _set_auth_headers

Show
BaseIntegrationTest Go To Implementation

A base class for integration test cases. It cleans up the Docker server

after itself.

Methods

  • setUp

  • tearDown

Show

Methods

  • test_reload

  • test_hash

Show
VolumesTest Go To Implementation

Methods

  • test_create_get

  • test_list_remove

Show
BaseHTTPAdapter Go To Implementation

Methods

  • close

  • get_connection_with_tls_context

Show
SSHConnectionTest Go To Implementation

Methods

  • test_ssh_unknown_host

Show
CreateConfigsTest Go To Implementation

Methods

  • test_create_config

Show
CreateServiceTest Go To Implementation

Methods

  • test_secrets_repr

Show
CreateServiceKwargsTest Go To Implementation

Methods

  • test_get_create_service_kwargs

Show
CopyReturnMagicMock Go To Implementation

A MagicMock which deep copies every return value.

Methods

  • _mock_call

Show

Methods

  • test_api_error_parses_json

Show

Methods

  • test_reload

Show

TLS configuration.

Args: client_cert (tuple of str): Path to client cert, path to client key. ca_cert (str): Path to CA cert file. verify (bool or str): This can be a bool or a path to a CA cert file to verify against. If True, verify using ca_cert; if False or not specified, do not verify.

Methods

  • configure_client

Show
CancellableStream Go To Implementation

Stream wrapper for real-time events, logs, etc. from the server.

Example:

events = client.events() for event in events: … print(event)

and cancel from another thread

events.close()

Methods

  • close

Show
SocketError Go To Implementation
Show
EndpointConfig Go To Implementation
Show
NetworkingConfig Go To Implementation
Show

Create an IPAM (IP Address Management) config dictionary to be used with :py:meth:~docker.api.network.NetworkApiMixin.create_network.

Args:

driver (str): The IPAM driver to use. Defaults to default. pool_configs (:py:class:list): A list of pool configurations (:py:class:~docker.types.IPAMPool). Defaults to empty list. options (dict): Driver options as a key-value dictionary. Defaults to None.

Example:

ipam_config = docker.types.IPAMConfig(driver=’default’) network = client.create_network(‘network1’, ipam=ipam_config)

Show

Create an IPAM pool config dictionary to be added to the pool_configs parameter of :py:class:~docker.types.IPAMConfig.

Args:

subnet (str): Custom subnet for this IPAM pool using the CIDR notation. Defaults to None. iprange (str): Custom IP range for endpoints in this IPAM pool using the CIDR notation. Defaults to None. gateway (str): Custom IP address for the pool’s gateway. aux_addresses (dict): A dictionary of key -> ip_address relationships specifying auxiliary addresses that need to be allocated by the IPAM driver.

Example:

ipam_pool = docker.types.IPAMPool( subnet=’124.42.0.0/16’, iprange=’124.42.0.0/24’, gateway=’124.42.0.254’, aux_addresses={ ‘reserved1’: ‘124.42.1.1’ } )

ipam_config = docker.types.IPAMConfig( pool_configs=[ipam_pool])

Show
Show

Describe a Swarm’s configuration and options. Use

:py:meth:~docker.api.swarm.SwarmApiMixin.create_swarm_spec

to instantiate.

Show
SwarmExternalCA Go To Implementation

Configuration for forwarding signing requests to an external certificate authority.

Args: url (string): URL where certificate signing requests should be sent. protocol (string): Protocol for communication with the external CA. options (dict): An object with key/value pairs that are interpreted as protocol-specific options for the external CA driver. ca_cert (string): The root CA certificate (in PEM format) this external CA uses to issue TLS certificates (assumed to be to the current swarm root CA certificate if not provided).

Show
Show
CredentialsNotFound Go To Implementation
Show
InitializationError Go To Implementation
Show