Dockerizing a Windows Service Docker for Windows

ぐ巨炮叔叔 提交于 2019-12-05 06:15:20

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!