8

I'm trying to get URL Rewrite 2.0 installed using this Dockerfile:

FROM microsoft/aspnet:4.6.2
WORKDIR /inetpub/wwwroot
COPY obj/Docker/publish .
ADD https://download.microsoft.com/download/C/9/E/C9E8180D-4E51-40A6-A9BF-776990D8BCA9/rewrite_amd64.msi /install/rewrite_amd64.msi
RUN net start MSIServer
RUN msiexec.exe /i c:\install\rewrite_amd64.msi /quiet /passive /qn /L*v "C:\package.log"

When I build the container image, I see this error message:

The Windows Installer Service could not be accessed. This can occur if the Windows Installer is not correctly installed. Contact your support personnel for assistance.

Looking at package.log after running the container, I see this:

SI (c) (30:A4) [08:32:10:438]: Failed to connect to server. Error: 0x80040150
SI (c) (30:A4) [08:32:10:438]: Note: 1: 2774 2: 0x80040150: 2774 2: 0x80040150

Executing net start msiserver on the running container returns a message that the service is already started, and Google says 0x80040150 could be a problem reading the registry.

Is it expected that installing URL Rewrite this way should work, or do I need to elevate permissions somehow?

Update: Running the same msiexec command on the running container successfully installs URL Rewrite.

Jared
  • 1,385
  • 11
  • 21

1 Answers1

14

I finally figured it out thanks to this article. Using PowerShell to run msiexec with the appropriate switches works. Oddly, it threw "Unable to connect to the remote server" when trying to also download the MSI using PowerShell, so I resorted to using ADD.

Here's the relevant portion of my Dockerfile:

WORKDIR /install
ADD https://download.microsoft.com/download/C/9/E/C9E8180D-4E51-40A6-A9BF-776990D8BCA9/rewrite_amd64.msi rewrite_amd64.msi
RUN Write-Host 'Installing URL Rewrite' ; \
    Start-Process msiexec.exe -ArgumentList '/i', 'rewrite_amd64.msi', '/quiet', '/norestart' -NoNewWindow -Wait
Jared
  • 1,385
  • 11
  • 21
  • 3
    The URL for the .msi has changed. For URL Rewrite version 2.1 x64 (English), it is now https://download.microsoft.com/download/1/2/8/128E2E22-C1B9-44A4-BE2A-5859ED1D4592/rewrite_amd64_en-US.msi. You can find all the versions at the bottom of this page: https://www.iis.net/downloads/microsoft/url-rewrite – Dan Sinclair Jul 19 '21 at 15:18
  • The URL for the .msi has changed. For URL Rewrite version 2.1 x64 (English), it is now https://download.microsoft.com/download/1/2/8/128E2E22-C1B9-44A4-BE2A-5859ED1D4592/rewrite_amd64_en-US.msi. You can find all the versions at the bottom of this page: https://www.iis.net/downloads/microsoft/url-rewrite – Dan Sinclair Jul 19 '21 at 15:18