Allow GitLab CI to use Docker Registry with Self Signed Certs

This is a follow-on to my last post about how to fix Docker errors when using self signed SSL certificates on your Docker Registry.

When you are using GitLab-CI, to push or pull from your private Docker Registry with self signed SSL certs, and using the Docker-in-Docker Runner approach, you need to tell each created docker container that it can trust the private Registry.

There are also issues with the latest version of docker dind, so you should pin the version to 19.03.0 (at least at the time of writing this article).

In your project’s .gitlab-ci.yaml, you need to define the services section like this:

services:
  - name: docker:19.03.0-dind
    command:
      - /bin/sh
      - -c
      - dockerd-entrypoint.sh --insecure-registry server.hostname.com:5443 || exit

 

Replace “server.hostname.com” with your Docker Registry instance hostname, and the port “5443”, with the port your Docker Registry is running on.

That should do it!

 


Posted

in

by

Tags:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

PHP Code Snippets Powered By : XYZScripts.com