Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 10.171.30.4:53: no such host

  build, docker, gitlab, yaml

Docker image from a Dockerfile.
Part" and potentially the "test-job"

variables:

EDIT PART

https://hub.docker.com/r/library/docker/)
DOCKER_VERSION: "20.10"

(https://docs.docker.com/engine/reference/builder/#healthcheck)
DOCKER_HEALTHCHECK_TIMEOUT: "60"

REGISTRY_USER: gitlab-ci-token
REGISTRY_PASSWORD: $CI_JOB_TOKEN
REGISTRY_TEST_URL: $CI_REGISTRY
REGISTRY_RELEASE_URL: $CI_REGISTRY
CONTAINER_TEST_IMAGE: $CI_REGISTRY_IMAGE:latest
K8S_SERVER: https://caas-cnp-sys.com.intraorange
K8S_GITLAB_USER: massive-migration

stages:

  • build-docker
  • deploy

.job_template_docker: &job_definition_docker
image: dockerproxy-iva.si.francetelecom.fr/docker:$DOCKER_VERSION
services:
– name: dockerproxy-iva.si.francetelecom.fr/docker:$DOCKER_VERSION-dind
alias: docker
tags:
– rsc
– docker-privileged
– shared
before_script:
– env | grep ^DOCKER_
– env | grep ^CI_
– docker info
– ‘[ -z "$REGISTRY_PASSWORD" ] && echo "Registry Password is not set or empty (or protected) in Secret Variables" && exit 1’
– ‘[ -z "$REGISTRY_USER" ] && echo "Registry User is not set or empty (or protected) in Secret Variables" && exit 1’
– echo $REGISTRY_PASSWORD | docker login $REGISTRY_TEST_URL –username $REGISTRY_USER –password-stdin

docker-build-job:
<<: *job_definition_docker
stage: build-docker
environment:
name: prod
script:
– nslookup 10.171.30.4
– echo $CONTAINER_TEST_IMAGE
– docker build –pull –build-arg "http_proxy=http://devwatt-proxy.si.fr.intraorange:8080" –build-arg "https_proxy=http://devwatt-proxy.si.fr.intraorange:8080" -t $CONTAINER_TEST_IMAGE .
– docker push $CONTAINER_TEST_IMAGE
– docker history $CONTAINER_TEST_IMAGE
– docker images $CONTAINER_TEST_IMAGE

deploy-job:
tags:
– rsc
– docker
image: dockerfactory-iva.si.francetelecom.fr/kubectl-client:1.8.11
stage: deploy
environment:
name: prod
before_script:
– echo "$K8S_CA_CRT" > ca.crt
– kubectl config set-cluster OBSIT-cluster –server=$K8S_SERVER –certificate-authority=ca.crt
– kubectl config set-credentials $K8S_GITLAB_USER –certificate-authority=ca.crt –token=$K8S_GITLAB_USER_TOKEN
– kubectl config set-context OBSIT-context –cluster=OBSIT-cluster –user=$K8S_GITLAB_USER
– kubectl config use-context OBSIT-context
script:
– kubectl apply -f deployment.yaml -n sandbox-obsit –validate=false
– kubectl delete pods -l app=massive-migration-portal -n sandbox-obsit

Source: Docker Questions

LEAVE A COMMENT