如何 Dockerize windows 应用程序

How to Dockerize windows application

我有一个 windows 应用程序,我想对其进行容器化。它是一个 windows 桌面应用程序(不是 Web 应用程序)。我做了一些搜索,发现很少有关于容器化桌面应用程序的信息。我想要容器化的应用程序在 WindowsServerCore 上运行良好。我的机器上有 Windowsservercore 映像。

我想知道如何将它容器化。有任何文档或有用的视频吗? 当我完成 dockerfile 后,我可以与我的应用程序 gui 交互吗???怎么样???

您可以在 StefanScherer/dockerfiles-windows

中找到大量基于 WindowsServiceCore 的应用程序示例

您需要编写一个 Dockerfile(例如 diskspd/Dockerfile 您 copy/unzip/install 您需要的应​​用程序。

FROM microsoft/windowsservercore:10.0.14393.1770

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

ENV DISKSPD_VERSION 2.0.17

RUN Invoke-WebRequest $('https://gallery.technet.microsoft.com/DiskSpd-a-robust-storage-6cd2f223/file/152702/1/Diskspd-v{0}.zip' -f $env:DISKSPD_VERSION) -OutFile 'diskspd.zip' -UseBasicParsing ; \
    Expand-Archive diskspd.zip -DestinationPath C:\ ; \
    Remove-Item -Path diskspd.zip ; \
    Remove-Item -Recurse armfre ; \
    Remove-Item -Recurse x86fre ; \
    Remove-Item *.docx ; \
    Remove-Item *.pdf

ENTRYPOINT [ "C:\amd64fre\diskspd.exe" ]

也就是说,仍然需要对 windowscoreserver 的完整 GUI 支持:
"Create base container with full GUI support".