将 D: Drive 添加到 Windows Server 2016 Docker 镜像

Hod*_*ist 5 docker windows-server-2016

如何将 D: 驱动器添加到 microsoft/windowsservercore 基础映像?我的 Windows Server 2016 服务器有一个 D: 驱动器。服务器是一个 AWS 实例。这是安装了本地 Docker 而不是已经存在了一段时间的“Docker for Windows”。

Hod*_*ist 6

我们让它工作。本质上,我们在注册表中添加了一个符号链接。

将此添加到 dockerfile:

RUN powershell -NoProfile -Command \
    New-Item -ItemType directory -Path C:\drived ; \
    New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices' -Name 'D:'  -Value '\??\C:\drived' -PropertyType String;
Run Code Online (Sandbox Code Playgroud)