Questions tagged [terraform-provider-docker]
18 questions
6
votes
1 answer
How can I make the Docker provider in Terraform wait for an address to become available before attempting to connect to it?
I have the following resource in Terraform:
provider "docker" {
host = "tcp://${digitalocean_droplet.docker_server.ipv4_address}:2376/"
}
This relies on the value ipv4_address to be known before it can connect to the docker machine. This value…
user377628
4
votes
1 answer
"Force" docker image creation in Terraform with docker_registry_image (kreuzwerker/docker)
I am developing series of lambdas that are using docker images. The first step is to create them and registering in AWS ECR (not sure if everything I am doing is ok, so any advice is welcomed :-) ):
terraform {
...
required_providers {
…

islegmar
- 71
- 5
3
votes
1 answer
How to force delete Docker image with terraform destroy
I was following a tutorial on terraform.io that has me provision a docker image and container using terraform, and then destroy the terraform stack. However, I get the following error:
Error: Unable to remove Docker image:
Error response from…

Yann Stoneman
- 953
- 11
- 35
2
votes
1 answer
Use terraform to push docker image to azure container registry
I am using terraform to provision the infrastructure for my project in Azure.
Part of the infrastructure is a container registry to store the docker images that will be used by kubernates. Since at the moment everything is provisioned using…

chenny
- 769
- 2
- 17
- 44
2
votes
1 answer
How to select correct docker provider in terraform 0.14
To integrate with Docker, I've setup my terraform as follows:
The required provider:
docker = {
source = "kreuzwerker/docker"
version = "2.11.0"
}
the instantiation of that provider:
provider "docker" {
}
And finally I use it as…

Jonny5
- 1,390
- 1
- 15
- 41
1
vote
1 answer
Terraform This object has no argument, nested block, or exported attribute named "latest"
i'm beginner in Terraform.
I tried to install docker image nginx on my local server but i have an issue when i launch the command
terraform plan
Error: Unsupported attribute │ │ on dockernginx.tf line 20, in resource "docker_container" "nginx": │ …

Kevin Gelasse
- 11
- 1
1
vote
0 answers
using the docker provider with terraform cloud throws "Cannot connect to the Docker daemon at unix:///var/run/docker.sock"
Where the pipelines run I do not have access to the underlying environment, I'm guessing the issue stems from attempting to use that provider at all with terraform?
provider:
terraform {
cloud {
organization = "myorg"
workspaces {
…

SebastianG
- 8,563
- 8
- 47
- 111
1
vote
1 answer
How I config zk port for kafka in terraform
As you know. kafka is depends on zookeeper.
I want to config zk port for kafka.
zk
terraform {
required_providers {
docker = {
source = "kreuzwerker/docker"
}
}
}
resource "docker_image" "zookeeper" {
name =…

Jasper
- 11
- 1
1
vote
0 answers
Terraform Docker Provider: Any way to execute command ON the Docker host?
Given the limitations of the Terraform Docker Provider (see Terraform Docker Provider: "Bind" port to specific network), is there a way to execute a command ON the Docker host AFTER a Container has been started?
Since you can't specify what Docker…

JD Allen
- 799
- 5
- 12
0
votes
0 answers
How to save docker logs in terraform
I have this terraform config:
locals {
service_set = toset(distinct(flatten([for _, v in flatten(fileset(path.module, "../services/**")) : basename(dirname(v))])))
}
resource "docker_image" "service" {
for_each = local.service_set
name …

Dan
- 179
- 1
- 1
- 13
0
votes
1 answer
panic: runtime error: index out of range when building docker image with terraform-provider-docker in github action runner
I am building docker images using Terraform's terraform-provider-docker in a giuhub hosted ubuntu runner.
This is the terraform configuration that builds the docker images:
resource "docker_registry_image" "images" {
count =…

chenny
- 769
- 2
- 17
- 44
0
votes
1 answer
Terraform docker_registry_image error: 'unable to get digest: Got bad response from registry: 400 Bad Request'
I am trying to use CDF for terraform to build and push a docker image to AWS ECR. I have decided to use terraform docker provider for it. Here is my code
class MyStack extends TerraformStack {
constructor(scope: Construct, name: string) {
…

Baran Karaaslan
- 13
- 2
0
votes
1 answer
Terraform - Cross provider resource config inheritance
I only recently started figuring out how Terraform works, but I have a very specific problem that I need to address and I cannot find an easy way to do it so far. I would like to setup terraform config in such a way, that there is a shared part of…

Mika Drakolis
- 1
- 2
0
votes
1 answer
Terraform asks for passphrase to Docker Host on each step
I am learning actually Terraform and I have been trying to use it to create docker containers on a remote server. It is working but the problem is It keeps asking for the passphrase on each step. I want to enter the passphrase only once in the…

joe1531
- 345
- 4
- 16
0
votes
2 answers
Terraform docker cannot authenticate with container registry for remote host
I am on a Windows machine using Terraform 0.13.4 and trying to spin up some containers on a remote host using Terraform and the Docker provider:
provider "docker" {
host = "tcp://myvm:2376/"
registry_auth {
address = "myregistry:443"
…

Angelos Bousias
- 73
- 2
- 7