FLSH
FLSH

Reputation: 353

Appending to base image's ENTRYPOINT

The microsoft/iis image Dockerfile has this line:

ENTRYPOINT ["C:\\ServiceMonitor.exe", "w3svc"]

In my image's dockerfile, which uses microsoft/iis as the base image, I have a powershell script which I would like to also run when the image runs as a container, so I have done this:

ENTRYPOINT ["powershell", "-executionpolicy", "bypass", "-command", "./my-script.ps1"]

The desired result is that the microsoft/iis image would run its' ENTRYPOINT, followed by my image running its' ENTRYPOINT. However it seems that my image's ENTRYPOINT completely overwrites the microsoft/iis one.

How do I get both ENTRYPOINTs to run?

Upvotes: 8

Views: 2703

Answers (1)

Simon I
Simon I

Reputation: 3586

You can not have multiple ENTRYPOINTs, but you could get this to work by putting both commands into a start-up.ps1 and running that as your ENTRYPOINT.

ADD start-up.ps1

ENTRYPOINT ['powershell', '.\start-up.ps1']

Upvotes: 2

Related Questions