title: Client.Timeout when trying to push to private gitlab registry from within docker container
body: <p>Since I want to build different docker images for testing and production within gitlab, I decided to use docker-in-docker deployment. I followed the gitlab guide (<a href="https://docs.gitlab.com/ee/ci/docker/using_docker_build.html" rel="nofollow noreferrer">https://docs.gitlab.com/ee/ci/docker/using_docker_build.html</a>). Specifically the 'Use docker-in-docker executor' section.</p>
  
  <p>Here is the contents of my gitlab-ci.yml file:</p>
  
  <pre><code>stages:
    - build_testing
  
  variables:
    MYSQL_RANDOM_ROOT_PASSWORD: 'true'
    MYSQL_USER: 'dev'
    MYSQL_PASSWORD: 'dev'
    MYSQL_DATABASE: 'debitor_management_test'
  
  image: docker:stable
  services:
  - name: docker:dind
    command: ["--insecure-registry=10.11.12.41:443"]
  
  
  build_testing:
    stage: build_testing
  
    script:
    - docker build -t 10.11.12.41/debitor_management_testing .
    - docker push 10.11.12.41/debitor_management_testing
  </code></pre>
  
  <p>The image is built, but the push fails with the message:</p>
  
  <pre><code>Get https://10.11.12.41/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  </code></pre>
  
  <p>I am able to ping the registry and can push images on the docker host, but not from within the container. How can this be fixed?</p>