Docker Desktop-虚拟文件系统和高山GIT SSL证书
在运行快速启动的第一个命令时,我很难与Windows上的Alpine/git一起使用Docker Desktop(docker run -name repo alpine/git clone https://github.com/docker/启动.git
)我收到错误:
致命:无法访问'https://github.com/docker/getting-started.git/':ssl证书问题:无法获得本地发行人证书
我在公司防火墙后面,所以这很有意义。但是我很困惑的是,我打算如何修改Docker内部的高山git设置。据我了解,Docker在虚拟Linux环境中运行,因此我将无法将证书文件拖放到任何目录Docker期望的任何目录中。
我会尝试执行Docker Run
以更新GitConfig,但这是行不通的,因为a)我无法克隆仓库作为图像开始,b)通往证书的路径不会' t有效,因为证书在我的操作系统文件系统上。
我已经尝试关注本指南探索文件系统Docker时使用,但这仅读取,因此我无法将证书数据馈送到那里的文件中。
当我不能克隆存储库来制作容器时,如何更新高山git的证书?
编辑:我不知道自己在使用Docker文件,但是在Torek的建议下,我尝试了以下编辑Alpine Git Docker文件,但是它似乎无法正常工作,给我错误<代码不支持的SSL后端“ Schannel”。支持的SSL后端:OpenSSL
,尽管试图在Docker文件中设置配置。
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"]
同样,我真的不知道我在这里做什么,因此,如果我对Docker Images/Files的工作方式有一些基本的误解,请告知。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论