hashicorp / terraform-provider-docker

As part of our introduction to self-service publishing in the Terraform Registry, this copy of the provider has been archived, and ownership has been transferred to active maintainers in the community. Please see the new location on the Terraform Registry: https://registry.terraform.io/providers/kreuzwerker/docker/latest
https://registry.terraform.io/providers/kreuzwerker/docker/latest
Mozilla Public License 2.0
132 stars 92 forks source link

Unable to find or pull image with digest #282

Open viceice opened 4 years ago

viceice commented 4 years ago

Terraform Version

Terraform v0.12.29
+ provider.docker v2.7.1
+ provider.helm v1.2.4
+ provider.kubernetes v1.11.4

Affected Resource(s)

Please list the resources as a list, for example:

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

terraform {
  required_providers {
    docker = "2.7.1"
  }
}

provider "docker" {
  host = "ssh://root@docker-worker2"
}

resource "docker_image" "nginx" {
  name     = "nginx:1.18.0-alpine@sha256:29dc24ed982665eb88598e0129e4ec88c2049fafc63125a4a640dd67529dc6d4"
}

resource "docker_container" "nginx" {
  name     = "nginx-example"
  image    = "nginx:1.18.0-alpine@sha256:29dc24ed982665eb88598e0129e4ec88c2049fafc63125a4a640dd67529dc6d4"
  restart  = "unless-stopped"
  start    = true
}

Debug Output

https://gist.github.com/viceice/b1a3b6a462988cf53c49a247b4d090da

Expected Behavior

pull docker image and create container

Actual Behavior

fails with error

Steps to Reproduce

  1. terraform apply -auto-approve -parallelism=1

Important Factoids

Simple docker install on ubuntu 18.04 with btrfs

Server:
 Containers: 13
  Running: 0
  Paused: 0
  Stopped: 13
 Images: 82
 Server Version: 19.03.12
 Storage Driver: btrfs
  Build Version: Btrfs v4.15.1
  Library Version: 102
 Logging Driver: journald
 Cgroup Driver: cgroupfs
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
 init version: fec3683
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.3.0-1032-azure
 Operating System: Ubuntu 18.04.4 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 4
 Total Memory: 3.793GiB
 Name: XXXX
 ID: XXXXX
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false