IM trying to deploy on prod. But was gotting this error
Error response from daemon: Get https://registry.gitlab.com/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
gitlab-ci:
docker_push:
stage: docker
services:
- docker:dind
script:
- apk add --no-cache docker
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com
- mvn -B package -Dmaven.test.skip=true docker:build -DpushImage
job_deploy_prod:
stage: deploy
only:
- master
- tags
when: manual
environment:
name: prod
variables:
SERVER: serverBNP-prod1
SSH_OPTS: -p 22 -l udoc -o BatchMode=true -o StrictHostKeyChecking=no
script:
- export VERSION=$(fgrep -m 1 -w version pom.xml | sed -re 's/^.*>(.*)<.*$/\1/')
- ssh $SSH_OPTS -i $HOME/.ssh/id_rsa $SERVER "docker login -u gitlab-ci-token -p $CI_JOB_TOKEN registry.gitlab.com"
- ssh $SSH_OPTS -i $HOME/.ssh/id_rsa $SERVER "docker rm -f proj"
- ssh $SSH_OPTS -i $HOME/.ssh/id_rsa $SERVER "docker pull registry.gitlab.com/bnp/proj:$VERSION"
- ssh $SSH_OPTS -i $HOME/.ssh/id_rsa $SERVER "docker run -d -p 8080:8080 -e 'SPRING_PROFILES_ACTIVE=prod' -v /etc/localtime:/etc/localtime -v /etc/timezone:/etc/timezone --name proj registry.gitlab.com/bnp/proj:$VERSION"
Does anyone knows how to fix it please.?
Thank you
Most of these problems are related to DNS errors.your git runner container can't find out what the ip of git is.I set up the git on a private network and I know what it's IP is.
Find Ip of registry.gitlab.com
on your network, and add it to /etc/hosts
of your runner server.(ex: 123.123.123.123)
123.123.123.123 registry.gitlab.com
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With