Gitlab-runner with insecure registry

Using Gitlab-Runner with an insecure registry

I have a self hosted Gitlab-CE server, and a self hosted docker registry (accessible through LAN only, so HTTP only). The goal is to be able to run pipelines, where the .gitlab-ci.yml pulls a docker image from this private docker repository. However, every time a job starts, the following error is thrown:

Running with gitlab-runner 13.5.0 (ece86343) on AS02 Docker Container Runner TcPipUEK
Preparing the "docker" executor
Using Docker executor with image ...
Authenticating with credentials from $DOCKER_AUTH_CONFIG
Pulling docker image ...
ERROR: Preparation failed: Error response from daemon: Get http: server gave HTTP response to HTTPS client (docker.go:142:0s)

So more concretely, it won’t successfully connect to and download from the private registry at I have the docker login credentials stored in $DOCKER_AUTH_CONFIG, and my Gitlab-Runner’s compose file looks like this:

version: '3'

    restart: always
    image: gitlab/gitlab-runner:latest
      - "8093:8093"
      TZ: Europe/Zurich
      - /var/run/docker.sock:/var/run/docker.sock
      - ./gitlab-runner-config:/etc/gitlab-runner
    command: ["--insecure-registry="]

Is there something I’m missing? The docs seem unclear on how to allow gitlab-runner's docker to connect to an insecure registry, does anyone know what needs to be done to get this working?

I figured out a way to solve this:

On the server on which the GitLab Runner is running, add the following option to your docker launch arguments (for me I added it to the DOCKER_OPTS in /etc/default/docker and restarted the docker engine): --insecure-registry, replacing the IP with your own insecure registry.