gpt4 book ai didi

windows-services - Docker化Windows服务 Docker for Windows

转载 作者:行者123 更新时间:2023-12-05 01:42:46 24 4
gpt4 key购买 nike

我有一个现有的 Windows 服务,我想将其移动到 Windows 中的 docker 容器中。我对此很陌生。如果有人可以帮助我如何创建 docker 镜像以将 windows 服务移动到 docker 中,那将会很有帮助。

最佳答案

首先,下载wait-service脚本你需要这样写 dockerfile

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

然后用dockerfile打开powershel和文件夹并运行

docker build .

关于windows-services - Docker化Windows服务 Docker for Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50741364/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com