airflow.providers.docker.hooks.docker
¶
Module Contents¶
Classes¶
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
.- Parameters
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
orNone
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.
- 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.
- Parameters
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.