Module Contents



Interact with a Docker Daemon and Container Registry.

class airflow.providers.docker.hooks.docker.DockerHook(docker_conn_id=default_conn_name, base_url=None, version=None, tls=None, timeout=DEFAULT_TIMEOUT_SECONDS)[source]

Bases: airflow.hooks.base.BaseHook

Interact with a Docker Daemon and Container Registry.

This class provide a thin wrapper around the docker.APIClient.

  • docker_conn_id (str | None) – Docker connection id where stored credentials to Docker Registry. If set to None or empty then hook does not login to Container Registry.

  • base_url (str | list[str] | None) – URL or list of URLs to the Docker server.

  • version (str | None) – The version of the API to use. Use auto or None for automatically detect the server’s version.

  • tls (docker.TLSConfig | bool | None) – Is connection required TLS, for enable pass True for use with default options, or pass a docker.tls.TLSConfig object to use custom configurations.

  • timeout (int) – Default timeout for API calls, in seconds.

property client_created: bool[source]

Is api_client created or not.

conn_name_attr = 'docker_conn_id'[source]
default_conn_name = 'docker_default'[source]
conn_type = 'docker'[source]
hook_name = 'Docker'[source]
static construct_tls_config(ca_cert=None, client_cert=None, client_key=None, verify=True, assert_hostname=None, ssl_version=None)[source]

Construct TLSConfig object from parts.

  • ca_cert (str | None) – Path to a PEM-encoded CA (Certificate Authority) certificate file.

  • client_cert (str | None) – Path to PEM-encoded certificate file.

  • client_key (str | None) – Path to PEM-encoded key file.

  • verify (bool) – Set True to verify the validity of the provided certificate.

  • assert_hostname (str | bool | None) – Hostname to match against the docker server certificate or False to disable the check.

  • ssl_version (str | None) – Version of SSL to use when communicating with docker daemon.


Create connection to docker host and return docker.APIClient (cached).


Create connection to docker host and return docker.APIClient (cached).

classmethod get_connection_form_widgets()[source]

Return connection form widgets.

classmethod get_ui_field_behaviour()[source]

Return custom field behaviour.

Was this entry helpful?