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 AS base


FROM 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"]

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
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 "" --label "" "C:ReposTotoAlertTotoAlert"
1>Sending build context to Docker daemon  64.83MB
1>Step 1/24 : FROM AS base
1> ---> 2dd992142057
1>Step 2/24 : WORKDIR /app
1> ---> Using cache
1> ---> 39afdbcfa2e1
1>Step 3/24 : FROM 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>,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