Dawn tns
Dawn tns

Reputation: 163

connection to gitlab container registry refused

I have enabled the Continer Registry on Gitlab under the gitlab.yml file where I have set the registry_external_url to look like this http://registry.domain. I have configured my .gitlab-ci.yml to log in Docker this way: docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY an I have set the following docker image:

image: docker:18-git

  services:

    - docker:18-dind

But whenever I run the pipeline, I get the following error:

Error logging in to v2 endpoint, trying next endpoint: Get https://registry.domain/v2/: dial tcp: lookup registry.domain on IP adress : no such host"

I'm thinking it's because I'm using http instead of https but I'm not really sure about it.

Upvotes: 4

Views: 5425

Answers (1)

Sachith Muhandiram
Sachith Muhandiram

Reputation: 2972

In your gitlab-runner running node's /etc/hosts file add (replace with your proper IP)

192.168.12.34 registry.domain

Then you may get insecure registry error

  1. /etc/docker/daemon.json (gitlab-runner running node's)
{
  "insecure-registries" : ["myregistrydomain.com:5000"]
}
  1. Restart docker in the node

Reference

Upvotes: 1

Related Questions