mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2026-01-04 05:49:35 -05:00
Terraform Provider - Docker
* 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> |
||
|---|---|---|
| .github | ||
| examples/ssh-protocol | ||
| internal/provider | ||
| scripts | ||
| tools | ||
| website | ||
| .gitignore | ||
| .go-version | ||
| .golangci.yml | ||
| .goreleaser.yml | ||
| .markdownlinkcheck.json | ||
| .markdownlint.yml | ||
| CHANGELOG.md | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| GNUmakefile | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| main.go | ||
| README.md | ||
Terraform Provider
- Website: https://www.terraform.io
- Provider: kreuzwerker/docker
- Slack: @gophers/terraform-provider-docker
Requirements
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
}