Replies: 1 comment
-
One thing you could try to help pinpoint the issue is to print the content of your NuGet.config file after running |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a dockerfile which uses a private Nuget feed to restore packages using the .Net 7 sdk image. I am able to run this using Docker Desktop and through our local Azure Devops pipeline without issues. By only changing to the .Net 8 sdk image, it now fails when doing the restore with the following error "error NU1301: Unable to load the service index for source https://tfs.example.com/tfs/Default/_packaging/nuget/v3/index.json." I've tried several other ways based on this link https://github.com/dotnet/dotnet-docker/blob/main/documentation/scenarios/nuget-credentials.md including using Azure Artifact Credential Provider without success. What has changed in the .Net 8 images that this no longer works? The PAT is passed in through an environment variable.
old dockerfile
`
FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build
WORKDIR /app
ARG PAT
COPY . ./
WORKDIR /app/myApp.Api
RUN dotnet nuget update source myFeed --valid-authentication-types basic --username "docker" --password "${PAT}" --store-password-in-clear-text
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS runtime
WORKDIR /app
COPY --from=build /app/myApp.Api/out ./
RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf
RUN apt-get update && apt-get -y install gss-ntlmssp
ENTRYPOINT ["dotnet", "myApp.Api.dll"]
`
new dockerfile
`
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /app
ARG PAT
COPY . ./
WORKDIR /app/myApp.Api
RUN dotnet nuget update source myFeed --valid-authentication-types basic --username "docker" --password "${PAT}" --store-password-in-clear-text
RUN dotnet restore
RUN dotnet publish -c Release -o out
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
WORKDIR /app
COPY --from=build /app/myApp.Api/out ./
RUN sed -i 's/DEFAULT@SECLEVEL=2/DEFAULT@SECLEVEL=1/g' /etc/ssl/openssl.cnf
RUN apt-get update && apt-get -y install gss-ntlmssp
ENTRYPOINT ["dotnet", "myApp.Api.dll"]
`
NuGet.config
<?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="myFeed" value="https://tfs.example.com/tfs/Default/_packaging/nuget/v3/index.json" /> <add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> </packageSources> </configuration>
Beta Was this translation helpful? Give feedback.
All reactions