I would like to create a Docker based on the Gitlab CI runner that pulls docker images for assembly from the private Docker registry (v2). I can not get Gitlab Runner to pull the image from the local registry, it is trying to get something from API /v1 . The following error message appears:
ERROR: Build error: Error retrieving image: Get http: // registry: 5000 / v1 / repositories / maven / images : type tcp: lookup registry at 127.0.1.1:53: no such host
Here is a minimal example using docker-compose and a web browser.
I have the following docker-compose.yml file:
version: "2" services: gitlab: image: gitlab/gitlab-ce ports: - "22:22" - "8080:80" links: - registry:registry gitlab_runner: image: gitlab/gitlab-runner volumes: - /var/run/docker.sock:/var/run/docker.sock links: - registry:registry - gitlab:gitlab registry: image: registry:2
After logging into Gitlab for the first time, I will register the runner in an instance of Gitlab:
root@130d08732613 :/
After that, I see the Gitlab runner in my Gitlab instance:

After that, I click a simple maven image into my newly created Docker repository:
vilmosnagy@vnagy-del l:~/$ docker tag maven:3-jdk-7 172.19.0.2:5000/maven:3-jdk7 vilmosnagy@vnagy-dell :~/$ docker push 172.19.0.2:5000/maven:3-jdk7 The push refers to a repository [172.19.0.2:5000/maven] 79ab7e0adb89: Pushed f831784a6a81: Pushed b5fc1e09eaa7: Pushed 446c0d4b63e5: Pushed 338cb8e0e9ed: Pushed d1c800db26c7: Pushed 42755cf4ee95: Pushed 3-jdk7: digest: sha256:135e7324ccfc7a360c7641ae20719b068f257647231d037960ae5c4ead0c3771 size: 1794
(I got the IP address 172.19.0.2 from the docker inspect )
After that, I create a test project in Gitlab and add a simple .gitlab-ci.yml :
image: registry:5000/maven:3-jdk-7 stages: - build - test - analyze maven_build: stage: build script: - "mvn -version"
And after the build, Gitlab gives the error seen at the beginning of the message.
If I enter the gitlab-runner working container, I can access the registry at the specified URL:
vilmosnagy@vnagy-dell :~/$ docker exec -it comptest_gitlab_runner_1 bash root@c0c5cebcc06f :/
But the error is still the same:

Do you have an idea how to make gitlab-runner use the private registry v2 api?