Terraform Provider - Docker
Find a file
Manuel Vogel ad3e56da2b
feat: migrate to terraform-sdk v2 (#102)
* chore: runs v2 upgrade cmd
* chore: moves all files into the internal provider dir
* feat: migrates main and provider
* fix: migrates tests to provider factories
* fix: replace import state passthrough ctx func
* chore: bump tf-sdk to v2.4.4
* fix: acc test by adding stop grace period
* fix: move to validate diag functions
* test: switch from ctx TODO to Background
* feat: add state upgrade for restart_policy and auth

Co-authored-by: Shunsuke Suzuki <suzuki-shunsuke@users.noreply.github.com>
2021-03-18 08:30:54 +01:00
.github chore: add the guide about Terraform Configuration in Bug Report (#139) 2021-03-11 21:15:11 +01:00
examples/ssh-protocol Add ssh protocol (copy) (#153). Closes #112 2019-05-26 21:06:10 +02:00
internal/provider feat: migrate to terraform-sdk v2 (#102) 2021-03-18 08:30:54 +01:00
scripts feat: migrate to terraform-sdk v2 (#102) 2021-03-18 08:30:54 +01:00
tools feat: add ability to lint/check of links in documentation locally (#98) 2020-12-27 19:02:34 +09:00
website chore: bump docker dependency to v20.10.5 (#119) 2021-03-08 21:18:21 +09:00
.gitignore chore: ignores testing folders 2020-12-24 16:26:29 +01:00
.go-version chore: bump go 115 (#297) 2020-10-13 11:23:18 +02:00
.golangci.yml feat: migrate to terraform-sdk v2 (#102) 2021-03-18 08:30:54 +01:00
.goreleaser.yml ci(goreleaser): switches from free to openbsd 2020-11-11 09:34:41 +01: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 feat: migrate to terraform-sdk v2 (#102) 2021-03-18 08:30:54 +01:00
GNUmakefile feat: migrate to terraform-sdk v2 (#102) 2021-03-18 08:30:54 +01:00
go.mod feat: migrate to terraform-sdk v2 (#102) 2021-03-18 08:30:54 +01:00
go.sum feat: migrate to terraform-sdk v2 (#102) 2021-03-18 08:30:54 +01: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: fix Github repository URL in README (#136) 2021-02-26 19:21:14 +01: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.8.0"
    }
  }
}

# Configure the docker provider
provider "docker" {
}

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

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