Forum Discussion

fswdev's avatar
fswdev
Copper Contributor
Aug 24, 2022

Unable to access Azure Artifact Feed while Docker build on Azure Pipeline

Hi,

 

i am using the following build step to build and publish an docker image to ACR, but ran into a problem accessing packages in my organization scoped Azure Artifact feed during the following build step:

 

- task: Docker@2
  displayName: 'Build and publish docker image'
  inputs:
    containerRegistry: 'acr_fluentsoftware'
    repository: 'pizza-shop-system'
    command: 'buildAndPush'
    Dockerfile: '$(Build.SourcesDirectory)/DBServer/Dockerfile'
    buildContext: '$(Build.SourcesDirectory)'

 

The Docker image being created is using this Dockerfile:

#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.

FROM mcr.microsoft.com/dotnet/runtime:6.0 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["NuGet.config", "."]
COPY ["DBServer/DBServer.csproj", "DBServer/"]
COPY ["DBServer.Devices.ReadModel/DBServer.Devices.ReadModel.csproj", "DBServer.Devices.ReadModel/"]
COPY ["DBServer.Persistence/DBServer.Persistence.csproj", "DBServer.Persistence/"]
COPY ["DBServer.Orders.ReadModel/DBServer.Orders.ReadModel.csproj", "DBServer.Orders.ReadModel/"]
RUN dotnet restore "DBServer/DBServer.csproj" --verbosity diag
COPY . .
WORKDIR "/src/DBServer"
RUN dotnet build "DBServer.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "DBServer.csproj" -c Release -o /app/publish /p:UseAppHost=false

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Heliprinter.DbServer.dll"]

In a previous buildstep (while building the solution without docker, the feed can be accessed, but within the docker buildstep I got errors for each package, that the package feed is not availble:

 

  "/src/DBServer/DBServer.csproj" (Restore target) (1) ->
                   (Restore target) -> 
                     /src/DBServer/DBServer.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json.
                     /src/DBServer.Persistence/DBServer.Persistence.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer/DBServer.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json.
                     /src/DBServer/DBServer.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json.
                     /src/DBServer/DBServer.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json.
                     /src/DBServer/DBServer.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json.
                     /src/DBServer/DBServer.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json.
                     /src/DBServer/DBServer.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json.
                     /src/DBServer/DBServer.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json.
                     /src/DBServer/DBServer.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json.
                     /src/DBServer/DBServer.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json.
                     /src/DBServer/DBServer.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json.
                     /src/DBServer/DBServer.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json.
                     /src/DBServer.Devices.ReadModel/DBServer.Devices.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Orders.ReadModel/DBServer.Orders.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Devices.ReadModel/DBServer.Devices.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Orders.ReadModel/DBServer.Orders.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Devices.ReadModel/DBServer.Devices.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Orders.ReadModel/DBServer.Orders.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Devices.ReadModel/DBServer.Devices.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Orders.ReadModel/DBServer.Orders.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Devices.ReadModel/DBServer.Devices.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Orders.ReadModel/DBServer.Orders.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Devices.ReadModel/DBServer.Devices.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Orders.ReadModel/DBServer.Orders.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Devices.ReadModel/DBServer.Devices.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Orders.ReadModel/DBServer.Orders.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Orders.ReadModel/DBServer.Orders.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Devices.ReadModel/DBServer.Devices.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Devices.ReadModel/DBServer.Devices.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]
                     /src/DBServer.Devices.ReadModel/DBServer.Devices.ReadModel.csproj : error NU1301: Unable to load the service index for source https://pkgs.dev.azure.com/fluentSoftware/_packaging/fluentSoftware/nuget/v3/index.json. [/src/DBServer/DBServer.csproj]

 

As you can see I use an NuGet.config to access the Azure Artifact Feed. Can anyone help with that?

 

 

No RepliesBe the first to reply

Resources