Adding ENTRYPOINT to the base image
The Dockerfile microsoft/iis
has the following line:
ENTRYPOINT ["C:\\ServiceMonitor.exe", "w3svc"]
In my image dockerfile which uses microsoft/iis
as base image, I have a powershell script that I would also like to run when the image is running as a container, so I did this:
ENTRYPOINT ["powershell", "-executionpolicy", "bypass", "-command", "./my-script.ps1"]
The desired result is that the image microsoft/iis
will run it ' ENTRYPOINT
and then my image will run from ENTRYPOINT
. However, it seems that my image is ENTRYPOINT
completely overwriting microsoft/iis
.
How do I run both ENTRYPOINT
?
You can't have multiple ENTRYPOINT
s, but you can get this to work by putting both commands in start-up.ps1 and running that as yoursENTRYPOINT
ADD start-up.ps1
ENTRYPOINTS ['powershell', '.\start-up.ps1']