kreuzwerker / terraform-provider-docker

Terraform Docker provider
Mozilla Public License 2.0
570 stars 187 forks source link

Support for using Data Sources without access to a Docker Daemon #634

Open jbeemster opened 4 days ago

jbeemster commented 4 days ago

Community Note

Description

I have a use-case where I want to leverage the docker_registry_image data sources in an environment where I don't have access to a Docker daemon but want to be able to validate that an image exists in a registry and fetch details of that image.

Currently this error comes back:

Error: Error pinging Docker server: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?

Would ideally like a way to disable needing access to the Docker daemon so I can still use resources that do not require it.

Potential Terraform Configuration

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file. For
# security, you can also encrypt the files using our GPG public key.

provider "docker" {
  disable_docker_daemon_check = true|false # default: false

  registry_auth {
    address  = "registry-1.docker.io"
  }
}