Do you run it from your gitlab-ci,yml file ? if yes, where are your runners hosted: are you using gitlab.com shared runners or are you self hosting your own runners ?
EDIT: Otherwise, it you are trying to login from your own server try an nslookup to see whether you can resolve registry.gitlab.com.
Yes i run it from gitlab-ci.yml inside the script tag and i’m using gitlab share runners.
i’m also try nslookup to registry.gitlab.com and here’s the result :
The failing resolution comes from the server, not from the gitlab runner. There may be a problem in the DNS resolution in your server. This can be anything, and it is a bit hard to know the reason.
Try using another nameserver or adding an additional one for the DNS resolution to fallback in case the default 127.0.0.1:53 fails.
Or just create a DOCKER_HOST variable. It will automatically get picked by docker add used to run your commands.
variables:
DOCKER_HOST: $SSH_USER@$SSH_SERVER_IP # You can define it globally on the UI if you don't use multiple hosts.
script:
- docker login -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD} ${CI_REGISTRY};