Gitlab-runner with docker-in-docker: "fatal: unable to update url base from redirection"

Hi!

I’ve set up a docker-in-docker runner and a .gitlab-ci.yml as per https://docs.gitlab.com/ce/ci/docker/using_docker_build.html#use-docker-in-docker-executor, in order to build a docker image.

At the start of the job, the docker images are set up:

Running with gitlab-runner 11.5.0 (3afdaba6)
  on dind-runner 7b9bff15
Using Docker executor with image docker:stable ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image sha256:edbe3f3ad406799b528fe6633c5553725860566b638cdc252e0520010436869f for docker:dind ...
Waiting for services to be up and running...
Pulling docker image docker:stable ...
Using docker image sha256:062267097b77e3ecf374b437e93fefe2bbb2897da989f930e4750752ddfc822a for docker:stable ...
Running on runner-7b9bff15-project-233-concurrent-0 via dind-runner...

But when it comes to cloning the repository, there is a fatal error message:

Cloning repository...
Cloning into '/builds/myproject/server/docker-cmake'...
fatal: unable to update url base from redirection:
asked for: https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@git.server.com/myproject/server/docker-cmake.git/info/refs?service=git-upload-pack
redirect: https://gitlab-ci-token:xxxxxxxxxxxxxxxxxxxx@git.server.com/?redirect_url=%2Fmyproject%2Fserver%2Fdocker-cmake.git%2Finfo%2Frefs
/bin/bash: line 68: cd: /builds/myproject/server/docker-cmake: No such file or directory
ERROR: Job failed: exit code 1

I didn’t find any hints why the git clone is failing.

I have the same question

Did you solve it?

Somebody?

I could only solve this by not using docker-in-docker.

Hi, do you have any link to info how to not perform D-in-D?