Create D drive in a docker container

2019-07-11 18:02发布

Is it possible to create a new partition with a drive letter other than C: in a docker Windows container?

I need a D:\ and an E:\ drive for some software.

2条回答
神经病院院长
2楼-- · 2019-07-11 18:24

This works in native Windows Server containers, but I had issues with it on docker-for-windows (Windows 10)

VOLUME ["D:"]

So for those in the same predicament, I found this worked for both.

Add D: Drive to Windows Server 2016 Docker Images

查看更多
爷的心禁止访问
3楼-- · 2019-07-11 18:27

I don't think you can do it from an existing image, but if you make a Dockerfile like so:

FROM <Base image like microsoft/dotnet-framework>
VOLUME ["D:"]
# Rest of Docker file here

The Windows container will create a D: Drive.

查看更多
登录 后发表回答