RockyLOMO 流水线构建github上的库超时,看了下日志是在 clone 的时候超时, 我本地github一直走代理, git config –global http.proxy ‘socks5://192.168.137.1:1080’ git config –global https.proxy ‘socks5://192.168.137.1:1080’ 无论我在 dockerfile RUN / ENTRYPOINT 或者在 流水线里 都不能生效。 有没有什么办法?
xushuxun 调试步骤: 1、开发本地安装jenkins,调试pipeline,看能不能正确git clone 2、如果本地jenkins可以,那么比对本地的~/.gitconfig和k8s pod中的 ~/.gitconfig是否一致 3、在流水线中curl或者wget,确认socks代理生效 4、确认流水线的git clone真的有使用~/.gitconfig 如果git clone走的不是git命令行,而是java实现的,那么可以直接设置jenkins的jvm启动参数,https://stackoverflow.com/questions/120797/how-do-i-set-the-proxy-to-be-used-by-the-jvm