Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 726
FLSH Avatar asked Mar 23 '17 12:03

FLSH


1 Answers

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']
like image 162
Simon I Avatar answered Oct 26 '22 07:10

Simon I