I ran through the quick nginx tutorial, but I keep getting an error:
Error: Unable to read Docker image into resource: Unable to find or pull image nginx
on main.tf line 1, in resource “docker_image” “nginx”:
1: resource “docker_image” “nginx” {
I tried enabling trace logs, but they don’t seem to provide much more info:
2020-04-22T22:20:28.929Z [DEBUG] plugin.terraform-provider-docker_v2.7.0_x4: 2020/04/22 22:20:28 [DEBUG] pulled image nginx:latest: {“status”:"Trying to pull repository docker.io/library/nginx … "}
2020-04-22T22:20:28.929Z [DEBUG] plugin.terraform-provider-docker_v2.7.0_x4: {“status”:“Pulling from docker.io/library/nginx",“id”:"latest”}
2020-04-22T22:20:28.929Z [DEBUG] plugin.terraform-provider-docker_v2.7.0_x4: {“status”:“Digest: sha256:d81f010955749350ef31a119fb94b180fde8b2f157da351ff5667ae037968b28”}
2020-04-22T22:20:28.929Z [DEBUG] plugin.terraform-provider-docker_v2.7.0_x4: {“status”:“Status: Image is up to date for docker.io/nginx:latest”}
2020/04/22 22:20:28 [DEBUG] docker_image.nginx: apply errored, but we’re indicating that via the Error pointer rather than returning it: Unable to read Docker image into resource: Unable to find or pull image nginx:latest
I can pull in an nginx image from docker manually without issue:
docker run --name mynginx1 -P -d nginx
So I’m just wondering what I might be doing wrong and/or what about my setup might be configured incorrectly? Also, what other ways, besides trace logs, are there for troubleshooting basic Terraform issues?
Thanks!