Cannot complete Getting Started with Docker Tutorial

Hey guys, I’m very new to Terraform and having trouble with the Getting Started with Docker tutorial found here https://developer.hashicorp.com/terraform/tutorials/docker-get-started/infrastructure-as-code . I followed the guide to a tee but have continued to get an error saying: Error: Unable to read Docker image into resource: unable to list Docker images: Error response from daemon: client version 1.41 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version.

Going to post relevant information below, but is this an Ubuntu issue? Or did I mess something up? Thanks for any help.

❯ sudo apt-get update && sudo apt-get install -y gnupg software-properties-common
Hit:1 http://archive.ubuntu.com/ubuntu noble InRelease
Hit:2 https://download.docker.com/linux/ubuntu noble InRelease
Get:3 http://archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]
Get:4 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]
Get:5 https://pkgs.tailscale.com/stable/ubuntu noble InRelease
Get:6 http://archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB]
Get:7 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Components [175 kB]
Get:8 http://archive.ubuntu.com/ubuntu noble-updates/restricted amd64 Components [212 B]
Get:9 http://archive.ubuntu.com/ubuntu noble-updates/universe amd64 Components [386 kB]
Get:10 https://esm.ubuntu.com/apps/ubuntu noble-apps-security InRelease [8,371 B]
Get:11 http://archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 Components [940 B]
Get:12 http://archive.ubuntu.com/ubuntu noble-backports/main amd64 Components [7,300 B]
Get:13 http://archive.ubuntu.com/ubuntu noble-backports/restricted amd64 Components [216 B]
Get:14 http://archive.ubuntu.com/ubuntu noble-backports/universe amd64 Components [10.5 kB]
Get:15 http://archive.ubuntu.com/ubuntu noble-backports/multiverse amd64 Components [212 B]
Get:16 https://esm.ubuntu.com/apps/ubuntu noble-apps-updates InRelease [8,220 B]
Get:17 https://esm.ubuntu.com/infra/ubuntu noble-infra-security InRelease [8,214 B]
Get:18 http://security.ubuntu.com/ubuntu noble-security/main amd64 Components [21.5 kB]
Get:19 https://esm.ubuntu.com/infra/ubuntu noble-infra-updates InRelease [8,213 B]
Get:20 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 Components [212 B]
Get:21 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Components [74.2 kB]
Get:22 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 Components [212 B]
Fetched 1,094 kB in 1s (960 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
gnupg is already the newest version (2.4.4-2ubuntu17.4).
gnupg set to manually installed.
software-properties-common is already the newest version (0.99.49.3).
software-properties-common set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
gaia οŒ›  ~
❯ wget -O- https://apt.releases.hashicorp.com/gpg | \
gpg --dearmor | \
sudo tee /usr/share/keyrings/hashicorp-archive-keyring.gpg > /dev/null
--2026-01-25 19:42:25--  https://apt.releases.hashicorp.com/gpg
Resolving apt.releases.hashicorp.com (apt.releases.hashicorp.com)... 2600:9000:2064:a200:18:566b:ecc0:93a1, 2600:9000:2064:1000:18:566b:ecc0:93a1, 2600:9000:2064:9000:18:566b:ecc0:93a1, ...
Connecting to apt.releases.hashicorp.com (apt.releases.hashicorp.com)|2600:9000:2064:a200:18:566b:ecc0:93a1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3980 (3.9K) [binary/octet-stream]
Saving to: β€˜STDOUT’

-                       100%[==============================>]   3.89K  --.-KB/s    in 0s

2026-01-25 19:42:25 (310 MB/s) - written to stdout [3980/3980]

gaia οŒ›  ~
❯ gpg --no-default-keyring \
--keyring /usr/share/keyrings/hashicorp-archive-keyring.gpg \
--fingerprint
gpg: directory '/home/gaia/.gnupg' created
gpg: /home/gaia/.gnupg/trustdb.gpg: trustdb created
/usr/share/keyrings/hashicorp-archive-keyring.gpg
-------------------------------------------------
pub   rsa4096 2023-01-10 [SC] [expires: 2028-01-09]
      798A EC65 4E5C 1542 8C8E  42EE AA16 FCBC A621 E701
uid           [ unknown] HashiCorp Security (HashiCorp Package Signing) <security+packaging@hashicorp.com>
sub   rsa4096 2023-01-10 [S] [expires: 2028-01-09]

gaia οŒ›  ~
❯ echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
deb [arch=amd64 signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com noble main
gaia οŒ›  ~
❯ sudo apt update
Hit:1 https://download.docker.com/linux/ubuntu noble InRelease
Hit:2 http://security.ubuntu.com/ubuntu noble-security InRelease
Get:3 https://apt.releases.hashicorp.com noble InRelease [12.9 kB]
Hit:4 http://archive.ubuntu.com/ubuntu noble InRelease
Get:5 https://pkgs.tailscale.com/stable/ubuntu noble InRelease
Get:6 https://apt.releases.hashicorp.com noble/main amd64 Packages [218 kB]
Hit:7 http://archive.ubuntu.com/ubuntu noble-updates InRelease
Hit:8 http://archive.ubuntu.com/ubuntu noble-backports InRelease
Hit:9 https://esm.ubuntu.com/apps/ubuntu noble-apps-security InRelease
Hit:10 https://esm.ubuntu.com/apps/ubuntu noble-apps-updates InRelease
Hit:11 https://esm.ubuntu.com/infra/ubuntu noble-infra-security InRelease
Hit:12 https://esm.ubuntu.com/infra/ubuntu noble-infra-updates InRelease
Fetched 237 kB in 1s (228 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
gaia οŒ›  ~
❯ sudo apt-get install terraform
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  terraform
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 30.6 MB of archives.
After this operation, 101 MB of additional disk space will be used.
Get:1 https://apt.releases.hashicorp.com noble/main amd64 terraform amd64 1.14.3-1 [30.6 MB]
Fetched 30.6 MB in 1s (59.2 MB/s)
Selecting previously unselected package terraform.
(Reading database ... 220161 files and directories currently installed.)
Preparing to unpack .../terraform_1.14.3-1_amd64.deb ...
Unpacking terraform (1.14.3-1) ...
Setting up terraform (1.14.3-1) ...
Scanning processes...
Scanning candidates...
Scanning processor microcode...
Scanning linux images...

Running kernel seems to be up-to-date.

The processor microcode seems to be up-to-date.

Restarting services...

Service restarts being deferred:
 systemctl restart libvirtd.service
 systemctl restart unattended-upgrades.service
 systemctl restart virtlockd.service
 systemctl restart virtlogd.service

No containers need to be restarted.

No user sessions are running outdated binaries.

VM guests are running outdated hypervisor (qemu) binaries on this host:
 'bit' with pid 2094
 'dns' with pid 3262
 'uptime-vm' with pid 3525
 'manga' with pid 3736
 'git' with pid 4011
gaia οŒ›  ~
❯ mkdir learn-terraform-docker-container
gaia οŒ›  ~
❯ cd learn-terraform-docker-container
gaia οŒ›  ~/learn-terraform-docker-container
❯ touch main.tf
gaia οŒ›  ~/learn-terraform-docker-container
❯ vim main.tf
gaia οŒ›  ~/learn-terraform-docker-container
❯ cat main.tf
terraform {
  required_providers {
    docker = {
      source = "kreuzwerker/docker"
      version = "~> 3.0.1"
    }
  }
}

provider "docker" {}

resource "docker_image" "nginx" {
  name         = "nginx:latest"
  keep_locally = false
}

resource "docker_container" "nginx" {
  image = docker_image.nginx.image_id
  name  = "tutorial"
  ports {
    internal = 80
    external = 8000
  }
}

gaia οŒ›  ~/learn-terraform-docker-container
❯ terraform init
Initializing the backend...
Initializing provider plugins...
- Finding kreuzwerker/docker versions matching "~> 3.0.1"...
- Installing kreuzwerker/docker v3.0.2...
- Installed kreuzwerker/docker v3.0.2 (self-signed, key ID BD080C4571C6104C)
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://developer.hashicorp.com/terraform/cli/plugins/signing
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
gaia οŒ›  ~/learn-terraform-docker-container
❯ terraform fmt
main.tf
gaia οŒ›  ~/learn-terraform-docker-container
❯ terraform validate
Success! The configuration is valid.

gaia οŒ›  ~/learn-terraform-docker-container
❯ terraform apply

Terraform used the selected providers to generate the following execution plan. Resource
actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # docker_container.nginx will be created
  + resource "docker_container" "nginx" {
      + attach                                      = false
      + bridge                                      = (known after apply)
      + command                                     = (known after apply)
      + container_logs                              = (known after apply)
      + container_read_refresh_timeout_milliseconds = 15000
      + entrypoint                                  = (known after apply)
      + env                                         = (known after apply)
      + exit_code                                   = (known after apply)
      + hostname                                    = (known after apply)
      + id                                          = (known after apply)
      + image                                       = (known after apply)
      + init                                        = (known after apply)
      + ipc_mode                                    = (known after apply)
      + log_driver                                  = (known after apply)
      + logs                                        = false
      + must_run                                    = true
      + name                                        = "tutorial"
      + network_data                                = (known after apply)
      + read_only                                   = false
      + remove_volumes                              = true
      + restart                                     = "no"
      + rm                                          = false
      + runtime                                     = (known after apply)
      + security_opts                               = (known after apply)
      + shm_size                                    = (known after apply)
      + start                                       = true
      + stdin_open                                  = false
      + stop_signal                                 = (known after apply)
      + stop_timeout                                = (known after apply)
      + tty                                         = false
      + wait                                        = false
      + wait_timeout                                = 60

      + healthcheck (known after apply)

      + labels (known after apply)

      + ports {
          + external = 8000
          + internal = 80
          + ip       = "0.0.0.0"
          + protocol = "tcp"
        }
    }

  # docker_image.nginx will be created
  + resource "docker_image" "nginx" {
      + id           = (known after apply)
      + image_id     = (known after apply)
      + keep_locally = false
      + name         = "nginx:latest"
      + repo_digest  = (known after apply)
    }

Plan: 2 to add, 0 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

docker_image.nginx: Creating...
β•·
β”‚ Error: Unable to read Docker image into resource: unable to list Docker images: Error response from daemon: client version 1.41 is too old. Minimum supported API version is 1.44, please upgrade your client to a newer version
β”‚
β”‚   with docker_image.nginx,
β”‚   on main.tf line 12, in resource "docker_image" "nginx":
β”‚   12: resource "docker_image" "nginx" {
β”‚
β•΅
gaia οŒ›  ~/learn-terraform-docker-container
❯ update
Hit:1 https://download.docker.com/linux/ubuntu noble InRelease
Hit:2 https://apt.releases.hashicorp.com noble InRelease
Hit:3 http://security.ubuntu.com/ubuntu noble-security InRelease
Hit:4 http://archive.ubuntu.com/ubuntu noble InRelease
Hit:5 http://archive.ubuntu.com/ubuntu noble-updates InRelease
Hit:6 http://archive.ubuntu.com/ubuntu noble-backports InRelease
Get:7 https://pkgs.tailscale.com/stable/ubuntu noble InRelease
Get:8 https://esm.ubuntu.com/apps/ubuntu noble-apps-security InRelease [8,371 B]
Get:9 https://esm.ubuntu.com/apps/ubuntu noble-apps-updates InRelease [8,220 B]
Get:10 https://esm.ubuntu.com/infra/ubuntu noble-infra-security InRelease [8,214 B]
Get:11 https://esm.ubuntu.com/infra/ubuntu noble-infra-updates InRelease [8,213 B]
Fetched 39.6 kB in 1s (35.1 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
gaia οŒ›  ~/learn-terraform-docker-container
❯ which docker
/usr/bin/docker
gaia οŒ›  ~/learn-terraform-docker-container
❯ docker --version
Docker version 29.1.5, build 0e6fee6
gaia οŒ›  ~/learn-terraform-docker-container
❯ ls -a
.  ..  main.tf  .terraform  .terraform.lock.hcl  terraform.tfstate
gaia οŒ›  ~/learn-terraform-docker-container
❯ cat main.tf
terraform {
  required_providers {
    docker = {
      source  = "kreuzwerker/docker"
      version = "~> 3.0.1"
    }
  }
}

provider "docker" {}

resource "docker_image" "nginx" {
  name         = "nginx:latest"
  keep_locally = false
}

resource "docker_container" "nginx" {
  image = docker_image.nginx.image_id
  name  = "tutorial"
  ports {
    internal = 80
    external = 8000
  }
} ```

Is this still an issue? It could be the version of the kreuzworker/docker plugin is old. You could try change it to 3.6.2 and see if it behaves better? Your version of docker seems OK. Might also be worth double checking the version of terraform you’re using too.

1 Like

Thanks for the reply! This solved the issue for me

1 Like

Amazing, I’m glad to hear it worked!

Just came across the same thing. Thanks for the help.
Is there a way to contribute to the docker tutorial? I could open a PR with the updated version.