aQ123
aQ123

Reputation: 590

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.

Upvotes: 9

Views: 9179

Answers (1)

VonC
VonC

Reputation: 1327364

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 

Upvotes: 10

Related Questions