I'm having trouble getting alpine/git to work with Docker Desktop on Windows, when running the first command of the Quick Start (docker run --name repo alpine/git clone https://github.com/docker/getting-started.git
) I receive the error:
fatal: unable to access 'https://github.com/docker/getting-started.git/': SSL certificate problem: unable to get local issuer certificate
I'm behind a corporate firewall, so this makes sense. But where I'm confused is how I'm meant to modify the settings for Alpine Git running inside of Docker. As I understand it, Docker runs in a virtual Linux environment, so I'm not going to be able to just drag and drop the certificate files into whatever directory Docker is expecting.
I would try doing docker run
to get the gitconfig updated, but that wouldn't work because a) I can't clone a repo to start as an image and b) the path to the cert wouldn't be valid because the cert is on my OS's file system.
I've tried following this guide on exploring the file system Docker uses, but this is read only so I can't feed the certificate data into a file there.
How can I update Alpine Git's certificates when I can't clone a repository to make a container?
Edit: I have no idea what I'm doing with docker files, but at the suggestion of torek I've tried editing the alpine git docker file like below, but it doesn't seem to work correctly, giving me the error Unsupported SSL backend 'schannel'. Supported SSL backends: openssl
despite having tried to set the config in the Docker file.
FROM alpine
RUN apk fix && \
apk --no-cache --update add git git-lfs less openssh && \
git lfs install && \
git config --system http.sslCAInfo /root.crt && \
git config --unset-all http.sslBackend
VOLUME /git
WORKDIR /git
COPY root.crt /
ENTRYPOINT ["git"]
CMD ["--help"]
Again I don't really know what I'm doing here, so if I have some fundamental misunderstanding of how Docker images/files work, please advise.