I'm trying to work my way through the Import Terraform Configuration tutorial on the learn.hashicorp.com site. When I try to run the terraform import command in the tutorial, I get the following error:
$ terraform import docker_container.web $(docker inspect --format="{{.ID}}" hashicorp-learn)
╷
│ Error: Error initializing Docker client: protocol not available
│
│ with provider["registry.terraform.io/kreuzwerker/docker"],
│ on /Users/ac8dqzz/myrepos/terraform/learn-terraform-import/main.tf line 14, in provider "docker":
│ 14: provider "docker" {
│
╵
Googling this error has not yielded anything of relevance to my particular case. My main.tf file looks like this:
terraform {
required_providers {
docker = {
source = "kreuzwerker/docker"
version = "~> 2.16"
}
}
required_version = ">= 0.14"
}
provider "docker" {
host = "npipe:////.//pipe//docker_engine"
}
Can anyone suggest what the problem here is?