Gitlab CI push to docker-registry fails I have GitLab server and a separate docker-registry. I have created a testuser with a testpassword.
My  .gitlab-ci.yml
image: docker:latest
services:
  - docker:18.09.7-dind
    
variables:
  DOCKER_HOST: tcp://docker:2375/
  DOCKER_DRIVER: overlay2
    # See https://github.com/docker-library/docker/pull/166
  DOCKER_TLS_CERTDIR: &quot;&quot;
  REGISTRY: myregistry:5000/golang-test

stages:
  - build
 # - test
before_script:
  - docker login -u testuser -p testpassword  myregistry:5000

build_project:
    stage: build
    tags:
      - docker-ci
    script:
      - docker ps
      - docker build -t $REGISTRY .
      - docker push $REGISTRY


When CI pipeline runs, I get following error.

WARNING! Using --password via the CLI is insecure. Use
--password-stdin. Error response from daemon: Get https://myregistry:5000/v2/: dial tcp: lookup worker1 on
192.168.123.456:53: no such host ERROR: Job failed: exit code 1

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = &quot;docker-ci&quot;
  url = &quot;https://gitlab.sample.com:8000/&quot;
  token = &quot;89MfxRTby83ny3eTkTf2&quot;
  tls-ca-file = &quot;/etc/gitlab-runner/certs/gitlab.sample.com.crt&quot;
  executor = &quot;docker&quot;
  pre_build_script = &quot;export DOCKER_HOST=tcp://docker:2375&quot;
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
  [runners.docker]
    tls_verify = false
    image = &quot;ubuntu:18.04&quot;
    privileged = true
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = [&quot;/cache&quot;]
    shm_size = 0

This was after suggested modifications here.
I can successfully login to my docker-registry using docker login -u testuser -p testpassword  https://myregistry:5000 from gitlab running server.
Are you sure that your registry is publicly available?
Checklist:

Check if the domain is reachable and responding the right IP address -- nslookup myregistry
Check if your port is open or not blocked any kind of software (let's say via firewalls or AWS security group) -- telnet myregistry 5050
Check if your registry is not restricted for a particular CIDR of IP
Test your login locally and ensure that there is no problem with it