Hi,
I’m trying to build Docker images with via GitLab Ci Pipeline.
A Runner is online and starts the Job on the host machine.
The Runner itself is a Docker Container.
According to the Dockerfile, docker tries to pull an image of our local registry but fails with:
x509: certificate signed by unknown authority
If I start the docker:dind manually on the host, connect to it and execute the commands the build works fine.
Does anyone experienced this before?
Thank you for your help!
Here is my .gitlab-ci.yml:
stages:
- Dockerfile
build_docker:
stage: Dockerfile
image: docker:latest
variables:
CI_JOB_TOKEN: <MY_CI_JOB_TOKEN>
services:
- docker:dind
script:
- curl -fSL "<MY_CA.crt>" -o /usr/local/share/ca-certificates/ca.crt
- mkdir -p /etc/ssl/certs/ && update-ca-certificates --fresh
- mkdir /root/.docker
- curl -fSL "<MY_AUTH_CONFIG>" -o /root/.docker/config.json
- docker info
- docker build -t <MY_REGISTRY>:<MY_TAG> .
- docker push <MY_REGISTRY>:<MY_TAG>