--- layout: "" page_title: "Provider: Docker" description: |- The Docker provider is used to interact with Docker containers and images. --- # Docker Provider The Docker provider is used to interact with Docker containers and images. It uses the Docker API to manage the lifecycle of Docker containers. Because the Docker provider uses the Docker API, it is immediately compatible not only with single server Docker but Swarm and any additional Docker-compatible API hosts. Use the navigation to the left to read about the available resources. ## Example Usage ```terraform provider "docker" { host = "tcp://127.0.0.1:2376/" } # Create a container resource "docker_container" "foo" { image = docker_image.ubuntu.latest name = "foo" } resource "docker_image" "ubuntu" { name = "ubuntu:latest" } ``` ## Schema ### 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 - **host** (String) The Docker daemon address - **key_material** (String) PEM-encoded content of Docker client private key - **registry_auth** (Block List, Max: 1) (see [below for nested schema](#nestedblock--registry_auth)) ### Nested Schema for `registry_auth` Required: - **address** (String) Address of the registry Optional: - **config_file** (String) Path to docker json file for registry auth - **config_file_content** (String) Plain content of the docker json file for registry auth - **password** (String, Sensitive) Password for the registry - **username** (String) Username for the registry