Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

URL Rewrite 2.0 installation fails on Docker

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.

like image 526
Jared Avatar asked Sep 05 '17 16:09

Jared


People also ask

How to enable URL Rewrite in IIS 8. 5?

First, open your IIS Manager and click on Default Web Site at the left panel. Double-click on the URL Rewrite module, as shown below, to add rewrite rules. 2. Next, click on Add Rule(s) option at the right panel, and a pop-up window appears where you'll select a rule template.

How do you check if URL Rewrite is enabled?

To see if the URL Rewrite module is installed, open IIS Manager and look in the IIS group - if the module is installed, an icon named URL Rewrite will be present.

How to enable URL Rewrite in IIS 10?

Click on Control Panel. Click on Program & Features. Enable IIS from the Add/Remove feature from the control panel if it is not selected at first. After enabling IIS, Install the URL Rewrite module if it is not previously installed.


1 Answers

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
like image 195
Jared Avatar answered Oct 14 '22 17:10

Jared