microsoft / DockerTools

Tools For Docker, including Visual Studio Provisioning and Publishing
Other
173 stars 26 forks source link

Opening stream failed, trying again with proxy settings #391

Open viniciusfonseca-trt17 opened 1 year ago

viniciusfonseca-trt17 commented 1 year ago

Hello,

I am trying to generate a Linux docker build with Visual Studio 2022 and ASPNET Core + React SPA project.

Whenever I try to build the project, the build fails and the log shows the error "Opening stream failed, trying again with proxy settings" and fail with timeout as follows:

1>C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -NoProfile -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:\Users\xxxxx\AppData\Local\Temp\GetVsDbg.ps1" -Version vs2017u5 -RuntimeID linux-x64 -InstallPath "C:\Users\xxxxx\vsdbg\vs2017u5" 1>Info: Using vsdbg version '17.6.10606.1' 1>Info: Using Runtime ID 'linux-x64' 1>Info: C:\Users\xxxxx\vsdbg\vs2017u5 exists, deleting. 1>Info: Opening stream failed, trying again with proxy settings.

The Dockerfile is just like below:

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/aspnet:7.0 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 RUN apt-get update RUN apt-get install -y curl RUN apt-get install -y libpng-dev libjpeg-dev curl libxi6 build-essential libgl1-mesa-glx RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - RUN apt-get install -y nodejs

FROM mcr.microsoft.com/dotnet/sdk:7.0 AS build WORKDIR /src COPY ["nuget.config", "."] COPY ["app.csproj", "appfolder"] RUN dotnet restore "app.csproj" COPY . . WORKDIR "/src/appfolder" RUN dotnet build "app.csproj" -c Release -o /app/build

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

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

I've tried to change Tools -> Option -> Environment -> Accounts -> System web browser, but it didn't work either. image

How can I setup the proxy in this case?

Regards.