Hi all
I am currently running a proof of concept based on GitLab EE running internally (not the hosted platform) - Ubuntu 18.04.
I am trying to use a self signed certificate / ca with GitLab Runner (running as a docker container) but I can’t for the life of me get it to work, I am probably missing something obvious.
This is what I have done:
- Copied the gitlab.xyz.com.crt to /usr/local/share/ca-certificates/
- Ran update-ca-certificates --fresh
- Checked the CA is now in /etc/ssl/certs/ca-certificates.crt (which it is)
- Created and registered GitLab Runner (via docker container), registration worked fine against the GitLab HTTPS url.
5.Copied the gitlab.xyz.com.crt to /srv/gitlab-runner/config/certs/ - Restarted docker
Command to create the GitLab Runner in docker:
docker run -d --name gitlab-runner --restart always -v /srv/gitlab-runner/config:/etc/gitlab-runner -v /var/run/docker.sock:/var/run/docker.sock gitlab/gitlab-runner:latest
Command to register the GitLab Runner:
docker run --rm -t -i -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register --docker-privileged --non-interactive --executor “docker” --docker-image alpine:latest --url “https://gitlab.xyz.com” --registration-token “xyz” --description “docker-runner” --tag-list “docker-gitlab-runner” --run-untagged --locked=“false”
Now when I push .gitlab-ci.yml for my repository and pipeline fires, the pipeline process is unable to build a docker image and push it to the registry due to x509: certificate signed by unknown authority issue:
…
Skipping Git submodules setup
$ echo “{“auths”:{”$CI_REGISTRY":{“username”:"$CI_REGISTRY_USER",“password”:"CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
error checking push permissions – make sure you entered the correct tag name, and that you are authenticated correctly, and try again: checking push permission for “gitlab.xyz.com:4567/sample-group1/sample-sub-group1/sample-project:latest”: creating push check transport for gitlab.xyz.com:4567 failed: Get https://gitlab.xyz.com:4567/v2/: x509: certificate signed by unknown authority
ERROR: Job failed: exit code 1
Is anyone able to give me some hints on what I am doing wrong here? I would be very grateful as I want to progress onto evolving my pipelines and testing out the GitLab CI/CD functionality eventually on my Kubernetes stack, but Docker is fine for now.
Thanks