【问题标题】:dotnet restore fails on a bitbucket pipeline configured with proxydotnet restore 在配置有代理的 bitbucket 管道上失败
【发布时间】:2019-01-18 22:28:48
【问题描述】:

我将通过我的远程主机路由来自正在运行的管道的所有流量。不幸的是,当进程遇到dotnet restore 时,它会失败。我有关于代理问题的想法,但所有东西都在片刻之前工作得很好。请给我指引正确的方向。


这里的环境

bibucket-pipeline.yml 文件

image: microsoft/dotnet:2.1-sdk
pipelines:
  default:
    - step:
        caches:
          - dotnetcore
        script:
          - curl https://api.ipify.org
          - ssh -fN -C -4 -D 41337 user@remotehost
          - export http_proxy='socks5://localhost:41337'
          - export https_proxy='socks5://localhost:41337'
          - curl https://api.ipify.org
          - dotnet restore
          - dotnet build
          - dotnet test

dotnet --info

.NET Core SDK (reflecting any global.json):
 Version:   2.1.302
 Commit:    9048955601
Runtime Environment:
 OS Name:     debian
 OS Version:  9
 OS Platform: Linux
 RID:         debian.9-x64
 Base Path:   /usr/share/dotnet/sdk/2.1.302/
Host (useful for support):
  Version: 2.1.2
  Commit:  811c3ce6c0
.NET Core SDKs installed:
  2.1.302 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.2 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 2.1.2 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

错误

/usr/share/dotnet/sdk/2.1.302/NuGet.targets(114,5):错误:无法 加载源https://api.nuget.org/v3/index.json 的服务索引。 [/opt/atlassian/pipelines/agent/build/PCT.sln]

/usr/share/dotnet/sdk/2.1.302/NuGet.targets(114,5):错误:只有 代理允许使用“http”方案。 [/opt/atlassian/pipelines/agent/build/PCT.sln]

【问题讨论】:

    标签: linux proxy .net-core nuget-package-restore bitbucket-pipelines


    【解决方案1】:

    到现在(12 月 18 日),dotnet restore 仍然不支持 socks5 代理。请改用 HTTP 代理。

    我使用 privoxy 将 socks5 代理流量转换为 http 代理。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-02-04
      • 1970-01-01
      • 2022-10-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-03-31
      相关资源
      最近更新 更多