Skip to content

habakke/terraform-provider-docker

Repository files navigation

Docker provider for terraform

This document describes how to build and use the docker terraform provider.

This provider lets you fetch information about docker images from a docker registry without requiring a local docker daemon

Example usage

terraform {
  required_providers {
    docker = "~> 1.0"
  }
}

provider "docker" {
  registry   = "index.docker.io"
  username   = ""
  password   = ""
}

data "docker_registry_image" "debian" {
  name = "library/debian"
  tag  = "latest"
}

How to build

To build an test the plugin locally first create a ~/.terraformrc file

provider_installation {

  dev_overrides {
    "habakke/docker" = "/Users/habakke/.terraform.d/plugins"
  }
  direct {}
}

Then build and install the plugin locally using

make install

Running tests

To run the internal unit tests run test test make target

make test

To run terraform acceptance tests, the TF_ACC env variable must be set to true before making the test make target, or the testacc make target can be used

make testacc

TODO