【发布时间】:2022-01-07 11:38:56
【问题描述】:
我正在尝试使用这个简单的 dockerfile 在 linux docker 容器中恢复 nuget 包:
FROM mcr.microsoft.com/dotnet/sdk:5.0 AS build-env
WORKDIR /app
# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore
使用 Windows 上的命令提示符使用此命令:
docker build --build-arg HTTP_PROXY=http://172.1.0.15:8080 --build-arg HTTPS_PROXY=http://172.1.0.15:8080 --no-cache -t test -f Dockerfile .
导致此错误:
[+] Building 1.7s (8/8) FINISHED
=> [internal] load build definition from Dockerfile 0.1s
=> => transferring dockerfile: 32B 0.0s
=> [internal] load .dockerignore 0.1s
=> => transferring context: 2B 0.0s
=> [internal] load metadata for mcr.microsoft.com/dotnet/sdk:5.0 0.2s
=> [1/4] FROM mcr.microsoft.com/dotnet/sdk:5.0@sha256:b2f3f15ee6100efdd36819a429b75d936e4be71bb2487cc48223554f08 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 4.17kB 0.0s
=> CACHED [2/4] WORKDIR /app 0.0s
=> [3/4] COPY *.csproj ./ 0.1s
=> ERROR [4/4] RUN dotnet restore 1.2s
------
> [4/4] RUN dotnet restore:
#7 0.961 Determining projects to restore...
#7 1.162 /usr/share/dotnet/sdk/5.0.403/NuGet.targets(131,5): error : Unable to load the service index for source https://api.nuget.org/v3/index.json. [/app/Test.csproj]
#7 1.162 /usr/share/dotnet/sdk/5.0.403/NuGet.targets(131,5): error : GSSAPI operation failed with error - Unspecified GSS failure. Minor code may provide more information (SPNEGO cannot find mechanisms to negotiate). [/app/Test.csproj]
------
executor failed running [/bin/sh -c dotnet restore]: exit code: 1
我错过了什么?
【问题讨论】:
标签: linux docker dockerfile nuget docker-desktop