Failed Pipeline connection to Private Registry

Hello,

i have an issue with my registry

i use insecure registry with selfed signed

if i want to connect to my registry with docker login registry.xxxx.xxx

it failes with Error response from daemon: Get “https://registry.xxx.xxxx/v2/”: dial tcp 192.168.40.240:443: connect: connection refused

and if i use docker login registry.xxxx.xxxx:80

it works (Login Succeeded)

i have configured insecure registry in docker deamon config and gitlab runner config

how i can fix this for piepelines?

thanks for help

1 Like

Hi,

Please share your .gitlab-ci.yml file as an example (and error log from a specific job) as well as your Runner config.toml. Otherwise it’s quite impossible to tell what configuration might you be missing.

Okay. So this is issue with your Ansible script and not GitLab? Does your Ansible script work outside the pipeline? E.g. executed from a server?

I’m not entirely sure how you are even executing this ansible-playbook command from the CI, since you are by default using only docker executor and alpine:latest image, with no visible Ansible installation.

no because there is the connection issue to registry

As I said, this is not issue with GitLab then. This is between Ansible and your docker registry. Make sure that your server with Ansible also has configured your insecure registry in /etc/docker/daemon.json.

yes it is configured the docker registry is from gitlab

Can you share then the configuration that you used to configure the registry?

yes sure

################################################################################
## Container Registry settings
##! Docs: https://docs.gitlab.com/ee/administration/packages/container_registry.html
################################################################################

 registry_external_url 'http://registry.xxxx.xxxx'

### Settings used by GitLab application
 gitlab_rails['registry_enabled'] = true
 gitlab_rails['registry_host'] = "registry.xxxx.xxxx"
# gitlab_rails['registry_port'] = "5005"
 gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry"

# Notification secret, it's used to authenticate notification requests to GitLab application
# You only need to change this when you use external Registry service, otherwise
# it will be taken directly from notification settings of your Registry
# gitlab_rails['registry_notification_secret'] = nil

###! **Do not change the following 3 settings unless you know what you are
###!   doing**
# gitlab_rails['registry_api_url'] = "http://127.0.0.1:5000"
# gitlab_rails['registry_key_path'] = "/var/opt/gitlab/gitlab-rails/certificate.key"
# gitlab_rails['registry_issuer'] = "omnibus-gitlab-issuer"

the registry connection for builds a running without Problems

Okay. So you’re saying, you can build and push images to the registry, but cannot login with Ansible?

Then you have to go to your Ansible server and figure it out. Has nothing to do with GitLab.