Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run git clone from docker file requiring SSL certificate

I have the following code in my Dockerfile:

FROM alpine/git as clone 
WORKDIR /app
RUN git clone https://github.com/spring-projects/spring-petclinic.git

However, I'm getting this error:

fatal: unable to access 'https://github.com/spring-projects/spring-petclinic.git/': SSL certificate problem: self signed certificate in certificate chain

I actually have a local git and I can't disable SSL certificate.

like image 486
aQ123 Avatar asked Aug 28 '18 23:08

aQ123


1 Answers

Try and add to your Dockerfile, before the git clone:

RUN apk add --update \
       ca-certificates \
    && update-ca-certificates

From there, as commented, you can clone the repo with an HTTPS URL like:

https://username:[email protected]/project_name.git 
like image 93
VonC Avatar answered Oct 23 '22 12:10

VonC