Coder Social home page Coder Social logo

gitlab-templates-3's Introduction

gitlab-templates

Set of reusable templates for gitlab-ci.

docker-dind-custom-ca.yml

When deploying gitlab-ci via helm charts using wildcard certificate (Option 2: Use your own wildcard certificate), the following error may occur when trying to build a docker image with AutoDevops / build stage:

 $ if [[ -z "$CI_COMMIT_TAG" ]]; then # collapsed multi-line command
 $ /build/build.sh
 Logging to GitLab Container Registry with CI credentials...
 WARNING! Using --password via the CLI is insecure. Use --password-stdin.
 Error response from daemon: Get https://registry.example.com/v2/: x509: certificate signed by unknown authority

The root cause was that AutoDevops/Build was not adding your private CA certificate to the /etc/ssl/certs directory so when the docker-dind tries to access your registry (with your private crt) it is unable to verify its authenticity.

This issue has been reported in gitlab ticket 1350 and the solution is based on this comment there which adds the custom CA to the /etc/ssl/certs/custom-ca.crt before starting docker-dind.

Usage

Option 1: Including the file from this repository. It would work in from a different public location or a fork of this repo.

include:
  - template: Auto-DevOps.gitlab-ci.yml
  - remote: https://raw.githubusercontent.com/joaocenoura/gitlab-templates/master/docker-dind-custom-ca.yml

Option 2: Copy/paste the contents of the file:

include:
  - template: Auto-DevOps.gitlab-ci.yml

build:
  services:
    - name: docker:19.03.5-dind
      command:
        - /bin/sh
        - -c
        - |
          echo "$CI_SERVER_TLS_CA_FILE" > /etc/ssl/certs/custom-ca.crt || exit
          dockerd-entrypoint.sh || exit

gitlab-templates-3's People

Contributors

joaocenoura avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.