Есть ли способ получить NuGet для образа Docker на основе Linux?
Я пробовал это:
ARG PAT
FROM microsoft/dotnet:sdk AS build
WORKDIR /app
COPY src/IdentityServer/ ./
# the annoying NuGet installation
RUN wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
RUN dpkg -i packages-microsoft-prod.deb
RUN apt-get install nuget
RUN nuget sources add -name yyyy-source https://xxxx.pkgs.visualstudio.com/_packaging/yyyy/nuget/v3/index.json -username dummy -password ${PAT}
RUN dotnet publish -c Release -o out
FROM microsoft/dotnet:aspnetcore-runtime AS runtime
WORKDIR /app
COPY --from=build /app/out ./
ENTRYPOINT ["dotnet", "IdentityServer.dll"]
Я понял:
Step 5/13 : RUN wget -q https://packages.microsoft.com/config/ubuntu/16.04/packages-microsoft-prod.deb
---> Using cache
---> db337597f4fe
Step 6/13 : RUN dpkg -i packages-microsoft-prod.deb
---> Running in c361881586a3
Selecting previously unselected package packages-microsoft-prod.
(Reading database ... 12109 files and directories currently installed.)
Preparing to unpack packages-microsoft-prod.deb ...
Unpacking packages-microsoft-prod (1.0-3) ...
Setting up packages-microsoft-prod (1.0-3) ...
Removing intermediate container c361881586a3
---> 6a56d436e5da
Step 7/13 : RUN apt-get install nuget
---> Running in c47705590796
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package nuget
The command '/bin/sh -c apt-get install nuget' returned a non-zero code: 100
но некоторые люди успешно устанавливают этот пакет NuGet в Linux:
Как установить NuGet из командной строки на Linux