Docker proxy host connect

  docker, dockerfile, gitlab-ci, gitlab-ci-runner, proxy

I am trying to build the dockerfile using gitlab pipeline push it.

.gitlab-ci.yml:

variables:
  http_proxy: http://inproxy1.dummycompany.co.in:8080
  https_proxy: http://inproxy1.dummycompany.co.in:8080
  no_proxy: "localhost,127.0.0.1,*inproxy1.dummycompany.co.in"
  BASE_IMAGE: docker:latest
  VERSION: 1
  ENV_TAG: ${CI_COMMIT_REF_NAME} 
  DOCKER_REPO_URL: docker.artifactory.dummycompany.com
  ARTIFACTORY_USER: $(ARTIFACTORY_USER)
  ARTIFACTORY_KEY: $(ARTIFACTORY_KEY)
  DOCKER_HOST: tcp://0.0.0.0:2375
  ARTIFACTORY_HOST: artifactory.dummycompany.com 
  ARTIFACTORY_PIP: artifactory.dummycompany.com/artifactory/api/pypi/pypi-virtual/simple

stages:
  - build
  - publish

publish:
  stage: publish
  image: $BASE_IMAGE
  tags:
    - kubernetes
  script:
    - docker login --username "$ARTIFACTORY_USER" --password "$ARTIFACTORY_KEY" $DOCKER_REPO_URL
    - make build
    - make push
    - docker logout $DOCKER_REPO_URL
  services:
    - images.artifactory.dummycompany.com/library/docker:dind

and makefile as:

build:
    @docker build 
            --env NO_PROXY="*.dummycompany.co.in,*0.0.0.0*" 
            --build-arg no_proxy=localhost,0.0.0.0,127.0.0.1,*.dummycompany.co.in 
            --build-arg http_proxy=http://inproxy1.dummycompany.co.in:8080 
            --build-arg https_proxy=http://inproxy1.dummycompany.co.in:8080 
            --build-arg ftp_proxy=http://inproxy1.dummycompany.co.in:8080 
            -t test-image 
            .

push:
    @docker push test-image

My pipeline is failing and i am getting the error as:

error during connect: Post http://0.0.0.0:2375/v1.40/auth: proxyconnect tcp: dial tcp: lookup inproxy1.dummycompany.co.in on 10.100.0.3:53: no such host

What could be the possible issue and how can i resolve it?

Source: Docker Questions

LEAVE A COMMENT