Terraform Provider - Docker
Find a file
renovate[bot] f8907bfd61
fix(deps): update module github.com/hashicorp/terraform-plugin-sdk/v2 to v2.6.1 (#181)
Co-authored-by: Renovate Bot <bot@renovateapp.com>
2021-04-30 09:48:50 +09:00
.github fix: skip sign on compile action 2021-04-21 14:12:36 +02:00
examples/ssh-protocol Add ssh protocol (copy) (#153). Closes #112 2019-05-26 21:06:10 +02:00
internal/provider fix: assign map to rawState when it is nil to prevent panic (#180) 2021-04-21 13:53:03 +02:00
scripts feat: support darwin arm builds and golang 1.16 (#140) 2021-03-18 23:21:49 +09:00
tools fix(deps): update module github.com/katbyte/terrafmt to v0.3.0 (#168) 2021-04-09 13:19:13 +02:00
website docs: add an example to build an image with docker_image (#158) 2021-03-29 10:09:08 +02:00
.gitignore chore: ignore dist folder 2021-04-21 14:11:32 +02:00
.go-version feat: support darwin arm builds and golang 1.16 (#140) 2021-03-18 23:21:49 +09:00
.golangci.yml feat: migrate to terraform-sdk v2 (#102) 2021-03-18 08:30:54 +01:00
.goreleaser.yml fix(deps): update module github.com/golangci/golangci-lint to v1.39.0 (#166) 2021-04-09 11:56:56 +02:00
.markdownlinkcheck.json ci: fix test of website 2020-12-12 01:21:02 +09:00
.markdownlint.yml ci: fix test of website 2020-12-12 01:21:02 +09:00
CHANGELOG.md chore: update changelog for v2.11.0 2021-01-22 21:10:38 +01:00
CODE_OF_CONDUCT.md docs: adds coc and contributing 2020-12-24 16:27:35 +01:00
CONTRIBUTING.md docs: format Guide of Bug report (#159) 2021-03-29 10:09:54 +02:00
GNUmakefile fix: skip sign on compile action 2021-04-21 14:12:36 +02:00
go.mod fix(deps): update module github.com/hashicorp/terraform-plugin-sdk/v2 to v2.6.1 (#181) 2021-04-30 09:48:50 +09:00
go.sum fix(deps): update module github.com/hashicorp/terraform-plugin-sdk/v2 to v2.6.1 (#181) 2021-04-30 09:48:50 +09:00
LICENSE initial commit 2017-06-05 20:59:08 +00:00
main.go feat: migrate to terraform-sdk v2 (#102) 2021-03-18 08:30:54 +01:00
README.md docs(readme): update example usage 2021-03-25 11:50:57 +01:00
renovate.json5 chore(renovate): configure Renovate (#162) 2021-04-07 10:53:58 +02:00

Terraform Provider

Requirements

  • Terraform >=0.12.x
  • Go 1.15.x (to build the provider plugin)

Building The Provider

$ git clone git@github.com:kreuzwerker/terraform-provider-docker
$ make build

Example usage

# Set the required provider and versions
terraform {
  required_providers {
    # We recommend pinning to the specific version of the Docker Provider you're using
    # since new versions are released frequently
    docker = {
      source  = "kreuzwerker/docker"
      version = "2.11.0"
    }
  }
}

# Configure the docker provider
provider "docker" {
}

# Create a docker image resource
# -> docker pull nginx:latest
resource "docker_image" "nginx" {
  name         = "nginx:latest"
  keep_locally = true
}

# Create a docker container resource
# -> same as 'docker run --name nginx -d nginx:latest'
resource "docker_container" "nginx" {
  name    = "nginx"
  image   = docker_image.nginx.latest
}