添加D:驱动器到Windows Server 2016 Docker映像 [英] Add D: Drive to Windows Server 2016 Docker Images

查看:126
本文介绍了添加D:驱动器到Windows Server 2016 Docker映像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How do I add a D: drive to the microsoft/windowsservercore base image? My Windows Server 2016 server has a D: drive. The server is an AWS instance. This is with native Docker installed and not the "Docker for Windows" that has been around for a while.

推荐答案

我们成功了。本质上,我们在注册表中添加了符号链接。

We got it to work. Essentially, we're adding a symbolic link in the registry.

将此添加到dockerfile:

Add this to the 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;

这篇关于添加D:驱动器到Windows Server 2016 Docker映像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆