为什么 wsl2 里用 Go 语言调 Command 模块执行 docker 命令没走代理?

查看 47|回复 0
作者:Albertcord   
之前在 github 上提了个issue,但发现没人回答,来 v 站求助下大佬
我的问题其实就是发现,我自己在 wsl2 里执行以下命令是可以访问到的:
curl -s -S -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer
但是我在用cog,这个库的时候发现其内部构建 Docker 镜像时获取不到上面这个 raw.githubxx ,这个链接,一直报 443 ,不过我刚刚又看了 issue ,发现怎么是报 Could not resolve host: raw.githubusercontent.com 了,我有段时间没去看了,可能我已经解决代理问题了?
继续说回问题,然后我自己写了个测试 DockerFile ,发现我 wsl2 里的 Docker 构建是会走代理的,所以很疑惑问题在哪里?有 Go 大佬帮帮忙吗,也在学 Go ,但进度有些慢,本身是前端,感觉缺少了什么上下文
FROM ubuntu
RUN apt update
RUN apt install -y git
RUN apt install -y curl
RUN cd ~
# RUN git clone https://github.com/momo-lab/pyenv-install
RUN echo $(curl -s -S -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer) > ~/test.text
您需要登录后才可以回帖 登录 | 立即注册

返回顶部