Chrome Installation Fails in Windows Docker Container: Non-Zero Code 3221225781

Running into an issue when trying to install a specific version of Chrome inside a Windows container and disable updates. As a tiny bit of background, this is for headless use with a Selenium C# driver within a .NET Core console app.

When building the image, it fails on the RUN command for the silent install. Any help would be much appreciated.

Here’s my 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"]

Build output:

1>------ Rebuild All started: Project: TotoAlert, Configuration: Debug Any CPU ------
1>TotoAlert -> C:ReposTotoAlertTotoAlertbinDebugnetcoreapp2.2TotoAlert.dll
1>Docker version 18.09.2, build 6247962
1>docker build -f "c:repostotoalerttotoalertdockerfile" -t totoalert  --label "com.microsoft.created-by=visual-studio" --label "com.microsoft.visual-studio.project-name=TotoAlert" "C:ReposTotoAlertTotoAlert"
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:UsersMZ.nugetpackagesmicrosoft.visualstudio.azure.containers.tools.targets.7.9buildContainer.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 ==========

Source: StackOverflow