Reaching unsecured docker from runner

Hi All,
I need to use a private gitlab environment in a totally separated network. I can enter to this network by vpn only. There is a gitlab and a docker repository at this environment. I cannot use lets’encrypt to generate certificate for docker repo, but there is no need to use it. I configured the .gilab-ci.yml like this:


  • name: docker:dind
    command: ["–insecure-registry=docker_ip_address:docker_port"]

when gitlab-runner starts, it try to use https instead of http like this:
Unable to push ‘docker_ip_address:dokcer_port/project’ to registry ‘docker_ip_address:docker_port’ : Get https://docker_ip_address:docker_port/v2/: Forbidden

When I try to check docker repository from my machine it works well with http.

I tried to create daemon.json in my gitlab-ci.yml like this:

  • mkdir /etc/docker
  • echo ‘{ “insecure-registries”:[ docker_ip_address:docker_port ] }’ > /etc/docker/daemon.json

but it doesn’t work.

How can I config gitlab-runner to use http instead of https?