Nomad 1.9.7 docker-credentials-ecr-login fails to pull images

Hello,

I’ve set up a 3 node server and 5 node client cluster with nomad OSS and I’m trying to get nomad to successfully pull images from ECR

Nomad 1.9.7
running as root

I’ve configured docker-credentials-ecr-login and configured ecr-helper in /etc/docker/config.json as a global configuration but also the same in /root/.docker/config.json

on the host and all the clients I can run a docker pull <ecr_URL> and the image is downloading successfully.

Deploying my job file to nomad gives me the following error

Driver Failure: Failed to pull `xxx.dkr.ecr.xx-xx-1.amazonaws.com/iws/gateway:1.0.17.java11`: Error response from daemon: Head "https://xxx.dkr.ecr.xx-xx-1.amazonaws.com/v2/iws/gateway/manifests/1.0.17.java11": no basic auth credentials

My docker object in my job file is pretty simple and should not impact nomadm to use ecr-helper

task "{{ iws_gateway_task_name }}" {
      driver = "docker"

      config {
        image       = "{{ iws_base_ecr_url }}{{ iws_gateway_image_uri }}:{{ iws_gateway_app_version }}"
        force_pull  = false
        dns_servers = [{{ consul_dns }}, "8.8.8.8"]
        volumes     = ["{{ iws_gateway.log_path }}:/logs"]

        port_map {
          srv = 8080
        }
      }

I’ve also tried to add this configuration within the docker block: Docker task driver | Nomad | HashiCorp Developer

but started receiving exceptions that helper and config are not known.

I’d appreciate any pointer to sort this out.

I’ve just solved it by following Deploying Docker container via ECR "Failed to find docker auth for repo"