问题
I have a existing Windows Service which I want to move to docker container in windows. I'm new to this. If somebody can help me how to create docker image to move windows service into docker, it would be helpful.
回答1:
First, download wait-service script You need to write dockerfile like this
FROM microsoft/windowsservercore
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
WORKDIR /
COPY Wait-Service.ps1 service.exe ./
RUN install_you_service
CMD c:\Wait-Service.ps1 -ServiceName 'service' -AllowServiceRestart
then open powershel and folder with you dockerfile and run
docker build .
来源:https://stackoverflow.com/questions/50741364/dockerizing-a-windows-service-docker-for-windows