6

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.

jonasm
  • 977
  • 1
  • 8
  • 14
  • its not a good idea to put the software on another drive for now... but Their is a way to move your docker-desktop-data to your other drive.. check this video https://www.youtube.com/watch?v=AyEw7JsHt9I – Jenuel Ganawed Jun 28 '21 at 04:58

2 Answers2

2

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.

0

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

Jules Clements
  • 418
  • 5
  • 8