Explain how to use kaniko with a registry with a custom certificate
This commit is contained in:
parent
89b0be149e
commit
68d172daec
1 changed files with 23 additions and 0 deletions
|
@ -57,3 +57,26 @@ build:
|
|||
only:
|
||||
- tags
|
||||
```
|
||||
|
||||
## Using a registry with a custom certificate
|
||||
|
||||
When trying to push to a Docker registry that uses a certificate that is signed
|
||||
by a custom CA, you might get the following error:
|
||||
|
||||
```sh
|
||||
$ /kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --no-push
|
||||
INFO[0000] Downloading base image registry.gitlab.example.com/group/docker-image
|
||||
error building image: getting stage builder for stage 0: Get https://registry.gitlab.example.com/v2/: x509: certificate signed by unknown authority
|
||||
```
|
||||
|
||||
This can be solved by adding your CA's certificate to the kaniko certificate
|
||||
store:
|
||||
|
||||
```yaml
|
||||
before_script:
|
||||
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
|
||||
- |
|
||||
echo "-----BEGIN CERTIFICATE-----
|
||||
...
|
||||
-----END CERTIFICATE-----" >> /kaniko/ssl/certs/ca-certificates.crt
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue