Newbie Question - Install Tutorial Error

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 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 … "}
2020-04-22T22:20:28.929Z [DEBUG] plugin.terraform-provider-docker_v2.7.0_x4: {“status”:“Pulling from",“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”}
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?


@mattdushane88 I ran into the exact same issue and eventually discovered that my environment had an old version of the Docker engine.

I was on CentOS7 with Docker 1.13.1 installed from the extras repository. I followed the instructions on the link below to get docker-ce 19.03.9 and everything started working. Hope that helps if you’re still stuck!