我有一个目录,其中包含要在.Net Framework Docker容器中复制和使用的私有NuGet软件包(packages
)。
我有以下内容:
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8 AS build
WORKDIR /app
# copy sln and multiple csproj
COPY MySolution.sln .
COPY ProjectOne/*.csproj ./ProjectOne/
COPY ProjectOne/*.config ./ProjectOne/
COPY ProjectTwo/*.csproj ./ProjectTwo/
COPY ProjectTwo/*.config ./ProjectTwo/
COPY packages .
RUN nuget restore
# copy everything else and build app
COPY ProjectOne/. ./ProjectOne/
WORKDIR /app
RUN msbuild /p:Configuration=Release ProjectOne
RUN msbuild /p:Configuration=Release ProjectTwo
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8 AS runtime
WORKDIR /inetpub/wwwroot
COPY --from=build /app/ProjectOne/. ./
COPY --from=build /app/ProjectTwo/. ./
但是我知道
Errors in packages.config projects
Unable to find version '1.0.0' of package 'Me.PrivatePackageOne'.
https://api.nuget.org/v3/index.json: Package 'Me.PrivatePackageOne.1.0.0' is not found on source 'https://api.nuget.org/v3/index.json'.
...
...
...
The command 'powershell -Command $ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue'; nuget restore' returned a non-zero code: 1
如何在容器中使用本地软件包?