No basic auth credentials error when using ECR image as a service

Hi, I have a .gitlab-ci.yml file like the following:


  DOCKER_DRIVER: overlay2

  - init

  stage: init
    - npm run init

As you can see I am using a private docker-dind image hosted on Amazon ECR as a service. Unfortunately GitLab gives me the following error:

ERROR: Preparation failed: Error response from daemon: Get no basic auth credentials (executor_docker.go:188:0s)

The GitLab runner has amazon-ecr-credential-helper installed, docker-credential-ecr-login binary is available on PATH and the following configuration

	"credsStore": "ecr-login"

has been added to ~/.docker/config.json file.

Also I have added the following in /etc/gitlab-runner/config.toml:

  name = "my-runner"
  url = ""
  token = "xyz"
  executor = "docker"
  environment = ["DOCKER_AUTH_CONFIG={ \"credsStore\": \"ecr-login\" }"]

The Gitlab runner has an IAM attached with the proper permissions to push/pull images from AWS ECR registry.

Anyone can help me understand what I am missing here? Why GitLab isn’t able to authenticate with ECR an pull the image?