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 ENTRYPOINT
s to run?
You can not have multiple ENTRYPOINT
s, 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']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With