0

I have a dotnet framework project that I am trying to build a windows container for the project on my Teamcity server. When ever I run a docker build it fails in the exact same step (RUN dotnet restore) every time both on Powershell and the Teamcity UI. See the error below:

enter image description here

enter image description here

And the content of the dockerfile:

FROM mcr.microsoft.com/dotnet/framework/sdk AS build

WORKDIR /src

# Restore Dependencies
COPY EmailMessage.WindowsService.sln .

COPY BankOne.Core/BankOne.Core.csproj .
COPY BankOne.Core/packages.config .

COPY BankOne.Data/BankOne.Data.csproj .
COPY BankOne.Data/packages.config .

COPY BankOne.EmailMessage/BankOne.EmailMessage.csproj .
COPY BankOne.EmailMessage/packages.config .

COPY BankOne.EmailMessage.Console/BankOne.EmailMessage.Console.csproj .

COPY BankOne.EmailMessage.WindowsService/BankOne.EmailMessage.WindowsService.csproj .
COPY BankOne.EmailMessage.WindowsService/packages.config .

COPY BankOne.Services/BankOne.Services.csproj .
COPY BankOne.Services/packages.config .

COPY SOA.Framework.BankOne.FunctionsMapping.CoreDB/SOA.Framework.BankOne.FunctionsMapping.CoreDB.csproj .

RUN dotnet restore

# Build
COPY . .
#RUN msbuild /p:Configuration=Release /m
RUN dotnet publish -c Release -o release --no-restore

FROM mcr.microsoft.com/dotnet/framework/runtime:4.8 AS runtime

EXPOSE 80
EXPOSE 808

WORKDIR /app

#COPY --from=build /src/BankOne.EmailMessage.Console/bin/release .
COPY --from=build /src/release .

CMD ["BankOne.EmailMessage.Console.exe"]


Note: the server is also protected in its own VPN

Gabe
  • 136
  • 2
  • 11
  • can you build the project outside a container? Anyway you don't build your project anywhere, you only pull the packages and then publish the app. – MakePeaceGreatAgain Jul 27 '22 at 14:37
  • Windows containers for Docker Desktop doesn't seem to work on my windows 11, so i have not been able to build locally. Didn't add a build step cos publish could also run the build. But the main issue is the process doesn't get passed the `dotnet restore` step – Gabe Jul 27 '22 at 15:01
  • I ment instead of using a dockerfile, just call `dotnet restore` in a shell and see what it prints. – MakePeaceGreatAgain Jul 27 '22 at 15:04
  • Alright, will try that – Gabe Jul 27 '22 at 15:05

0 Answers0