### Basic Docker Provider Configuration Source: https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs Configure the Docker provider for Terraform 0.13 and later, specifying the source, version, and host connection. This example also shows how to pull a Docker image and create a container. ```terraform terraform { required_providers { docker = { source = "kreuzwerker/docker" version = "4.0.0" } } } provider "docker" { host = "unix:///var/run/docker.sock" } # Pulls the image resource "docker_image" "ubuntu" { name = "ubuntu:latest" } # Create a container resource "docker_container" "foo" { image = docker_image.ubuntu.image_id name = "foo" } ``` -------------------------------- ### Provider Configuration Schema Source: https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs Configuration options for the Docker provider, including host connection and authentication settings. ```APIDOC ## Provider Configuration ### Description Configuration settings for the Docker provider to establish connection to the Docker daemon and manage registry authentication. ### Parameters #### Optional - **ca_material** (String) - PEM-encoded content of Docker host CA certificate - **cert_material** (String) - PEM-encoded content of Docker client certificate - **cert_path** (String) - Path to directory with Docker TLS config - **context** (String) - The name of the Docker context to use. Overrides the host if set. - **disable_docker_daemon_check** (Boolean) - If true, the provider will not check if the Docker daemon is running. - **host** (String) - The Docker daemon address - **key_material** (String) - PEM-encoded content of Docker client private key - **registry_auth** (Block Set) - Configuration for registry authentication - **ssh_opts** (List of String) - Additional SSH option flags for ssh:// protocol ### Nested Schema for registry_auth #### Required - **address** (String) - Address of the registry #### Optional - **auth_disabled** (Boolean) - If true, the provider uses dummy credentials. Defaults to false. - **config_file** (String) - Path to docker json file for registry auth. Defaults to ~/.docker/config.json. - **config_file_content** (String) - Plain content of the docker json file for registry auth. - **password** (String) - Password for the registry. - **username** (String) - Username for the registry. ``` -------------------------------- ### Registry Authentication with Config File Source: https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs Configure registry authentication for the Docker provider using a configuration file. Supports different registries and authentication methods, including username/password and config file content. ```terraform provider "docker" { host = "tcp://localhost:2376" registry_auth { address = "registry-1.docker.io" config_file = pathexpand("~/.docker/config.json") } registry_auth { address = "registry.my.company.com" config_file_content = var.plain_content_of_config_file } registry_auth { address = "quay.io:8181" username = "someuser" password = "somepass" } } ``` ```json { "auths": { "repo.mycompany:8181": { "auth": "dXNlcjpwYXNz=" }, "otherrepo.other-company:8181": {} }, "credsStore": "osxkeychain" } ``` -------------------------------- ### TLS Certificate Configuration for Docker Host Source: https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs Configure the Docker provider to connect to a Docker host using TLS. Specify certificate information either by providing a path to a directory or by directly providing the content of the CA, certificate, and key files. ```terraform provider "docker" { host = "tcp://your-host-ip:2376/" # -> specify either cert_path = pathexpand("~/.docker") # -> or the following ca_material = file(pathexpand("~/.docker/ca.pem")) # this can be omitted cert_material = file(pathexpand("~/.docker/cert.pem")) key_material = file(pathexpand("~/.docker/key.pem")) } ``` -------------------------------- ### Registry Image Data Source Source: https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs Use the `docker_registry_image` data source to fetch information about a Docker image from a registry. This can be used without a running Docker daemon if `disable_docker_daemon_check` is set to true in the provider configuration. ```terraform data "docker_registry_image" "quay" { name = "myorg/privateimage" } ``` ```terraform data "docker_registry_image" "quay" { name = "quay.io:8181/myorg/privateimage" } ``` -------------------------------- ### Connect to Remote Docker Host via SSH Source: https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs Configure the Docker provider to connect to a remote Docker host using the SSH protocol. Includes options for SSH connection and host key checking. ```terraform provider "docker" { host = "ssh://user@remote-host:22" ssh_opts = ["-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null"] } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.