I can’t find more information in the Terraform provider documentation, neither can I find any open issues in github.
https://www.terraform.io/registry/providers/docs
https://github.com/hashicorp/terraform/issues?q=is%3Aissue+is%3Aopen+provider+attribute+deprecated
Terraform code:
terraform {
required_providers {
docker = {
source = "kreuzwerker/docker"
version = "~> 2.13.0"
}
}
}
provider "docker" {}
resource "docker_image" "nginx" {
name = "nginx:latest"
keep_locally = false
}
resource "docker_container" "nginx" {
image = docker_image.nginx.latest
name = "nginx"
ports {
internal = 80
external = 8000
}
}
Deprecation:
2
Answers
Refer to the provider documentation, not Terraform. The provider is
kreuzwerker/docker
and issues for it would be on its own Github page.According to the kreuzwerker documentation, you need to change the version in your
required_providers
block:And also, change the way how you’re setting the image in the
docker_container
: