Проблема при попытке установить определенную версию Chrome в контейнере Windows и отключить обновления.В качестве небольшого фона, он предназначен для автономного использования с драйвером Selenium C # в консольном приложении .NET Core.
При создании образа происходит сбой команды RUN для установки без вывода сообщений.Любая помощь будет высоко ценится.
Вот мой Dockerfile :
FROM mcr.microsoft.com/dotnet/core/runtime:2.2-nanoserver-1809 AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-nanoserver-1809 AS build
# Copy over the Selenium driver, and installer for the specific version of Chrome we need for the driver and run it
RUN echo "Copying files..."
RUN mkdir files
COPY ./Files/ /files/
RUN echo "Installing Chrome..."
RUN ["C:/files/73.0.3683.86_chrome_installer64.exe", "/silent", "/install"]
RUN echo "Disabling Chrome auto-updates..."
#RUN powershell -Command Get-Service gupdate* | Stop-Service
CMD ["powershell.exe", "Get-Service gupdate* | Stop-Service"]
WORKDIR /src
COPY ["TotoAlert/TotoAlert.csproj", "TotoAlert/"]
RUN dotnet restore "TotoAlert/TotoAlert.csproj"
COPY . .
WORKDIR "/src/TotoAlert"
RUN dotnet build "TotoAlert.csproj" -c Release -o /app
FROM build AS publish
RUN dotnet publish "TotoAlert.csproj" -c Release -o /app
FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "TotoAlert.dll"]
Вывод сборки:
1>------ Rebuild All started: Project: TotoAlert, Configuration: Debug Any CPU ------
1>TotoAlert -> C:\Repos\TotoAlert\TotoAlert\bin\Debug\netcoreapp2.2\TotoAlert.dll
1>Docker version 18.09.2, build 6247962
1>docker build -f "c:\repos\totoalert\totoalert\dockerfile" -t totoalert --label "com.microsoft.created-by=visual-studio" --label "com.microsoft.visual-studio.project-name=TotoAlert" "C:\Repos\TotoAlert\TotoAlert"
1>Sending build context to Docker daemon 64.83MB
1>
1>Step 1/24 : FROM mcr.microsoft.com/dotnet/core/runtime:2.2-nanoserver-1809 AS base
1> ---> 2dd992142057
1>Step 2/24 : WORKDIR /app
1> ---> Using cache
1> ---> 39afdbcfa2e1
1>Step 3/24 : FROM mcr.microsoft.com/dotnet/core/sdk:2.2-nanoserver-1809 AS build
1> ---> a8d0891bb7d0
1>Step 4/24 : RUN echo "Copying files..."
1> ---> Using cache
1> ---> 412f307723dc
1>Step 5/24 : RUN mkdir files
1> ---> Using cache
1> ---> 9b0e904e05fe
1>Step 6/24 : COPY ./Files/ /files/
1> ---> Using cache
1> ---> 5249f9ec7265
1>Step 7/24 : RUN echo "Installing Chrome..."
1> ---> Using cache
1> ---> c836d3a9c3da
1>Step 8/24 : RUN ["C:/files/73.0.3683.86_chrome_installer64.exe", "/silent", "/install"]
1> ---> Running in 591527dec05d
1>The command 'C:/files/73.0.3683.86_chrome_installer64.exe /silent /install' returned a non-zero code: 3221225781
1>C:\Users\MZ\.nuget\packages\microsoft.visualstudio.azure.containers.tools.targets\1.7.9\build\Container.targets(196,5): error CTP1001: An error occurred while attempting to build Docker image.
1>Done building project "TotoAlert.csproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========