Terraform Provider - Docker
Find a file
Shunsuke Suzuki ccec463f6f
Merge pull request #38 from kreuzwerker/ci-ubuntu2004-workflow
ci: update ubuntu images and docker version
2020-12-25 20:18:28 +09:00
.github Merge pull request #38 from kreuzwerker/ci-ubuntu2004-workflow 2020-12-25 20:18:28 +09:00
docker chore: introduces golangci-lint (#32) 2020-12-20 11:04:51 +01:00
examples/ssh-protocol Add ssh protocol (copy) (#153). Closes #112 2019-05-26 21:06:10 +02:00
scripts ci: add gofmt's '-s' option 2020-12-12 19:26:11 +09:00
website doc: devices is a block, not a boolean 2020-12-18 22:31:32 -05: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 chore: introduces golangci-lint (#32) 2020-12-20 11:04:51 +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: updates changelog for 2.9.0 2020-12-25 09:02:52 +01:00
CODE_OF_CONDUCT.md docs: adds coc and contributing 2020-12-24 16:27:35 +01:00
CONTRIBUTING.md docs: adds coc and contributing 2020-12-24 16:27:35 +01:00
GNUmakefile ci: add gofmt's '-s' option 2020-12-12 19:26:11 +09:00
go.mod chore: bump go 115 (#297) 2020-10-13 11:23:18 +02:00
go.sum feat: adds docker Image build feature (#283) 2020-10-07 20:06:13 +02:00
LICENSE initial commit 2017-06-05 20:59:08 +00:00
main.go Move to standalone plugin SDK (#200) 2019-10-09 20:25:38 +02:00
README.md docs(readme): updates links to provider and slack 2020-12-25 10:20: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:terraform-providers/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 Azure 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
}