URL Rewrite 2.0 installation fails on Docker

4

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.

dockerfile
url-rewrite-module
asked on Stack Overflow Sep 5, 2017 by Jared • edited Sep 6, 2017 by Jared

1 Answer

6

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
answered on Stack Overflow Sep 6, 2017 by Jared

User contributions licensed under CC BY-SA 3.0