Docker Community Forums

Share and learn in the Docker community.

Cannot change default 20G size limit on Windows Docker host

Hi all,

I am running to the default limit of 20 GB building images with Docker for Windows. I could easily change the disk size for one particular container by running it with --storage-opt size option:

docker run --storage-opt size=120G microsoft/windowsservercore powershell

Sadly, it does not help me because I need large disk size available during build process. I’ve tried the following:

  1. to call dockerd --storage-opt size=120G
  2. to call dockerd --storage-opt dm.basesize=120G
  3. to edit docker daemon.json adding:
    “storage-opts”: [
  4. to edit docker daemon.json adding:
    “storage-opts”: [

Nothing helped. Does anyone have any fresh hints? I’m running out of ideas :slight_smile:

Kind regards,

1 Like

Hm, I seem to be able to override this as a daemon opt:

.\dockerd.exe --storage-opt size=30G
docker run --storage-opt size=30G microsoft/nanoserver powershell -c get-psdrive

Name           Used (GB)     Free (GB) Provider      Root
----           ---------     --------- --------      ----
Alias                                  Alias
C                   0.16         29.72 FileSystem    C:\

Here’s how to make that permanent:

net stop docker
.\dockerd --unregister-service
.\dockerd --register-service -storage-opt size=30G
net start docker

Let me know if that doesn’t work.

Hi Michael,

i’ve tested this now.

dockerd --register-service --storage-opt size=30G
for this I get

net start docker
The Docker Engine service is starting.
The Docker Engine service could not be started.

More help is available by typing NET HELPMSG 3523.
The *** service could not be started.

dockerd --register-service --storage-opt size=20G

The Docker Engine service is starting.
The Docker Engine service could not be started.

A system error has occurred.

System error 1067 has occurred.

The process terminated unexpectedly.

And for
dockerd --register-service
The service starts successfully.

I have 265 GB disk space on that host.

Any updates on this ?

When I execute net stop docker, an error is encountered as below:
System error 1060 has occurred.
The specified service does not exist as an installed service.

And when I execute .\dockerd, another error is encountered as below:
bash: .dockerd: command not found

@friism Would you please help on the process you followed on windows to get these commands executed ?


I am running into the same issue as the OP and have not been able to find any info as to how to do this on Docker for Windows. I have about 20GB that I need to copy into the container at the build stage.

From the following, it looks like I am stuck with the default overlay2 that comes with Docker for Windows:

From the following, it looks like increasing the storage above the default requires something other than overlay (which I am stuck with):

However, from this post, under " Configure Docker with Configuration File" , it says that the storage-driver and storage-opts are available for user configuration on Docker for Windows…

Note that I have tried updating the daemon.json and restarting Docker with no luck (setting “storage-driver”: “devicemapper”,“storage-opts”: [“dm.basesize=30GB”] in the json file as suggested by the post from Microsoft, but it didn’t work. “docker info” revealed no changes after a docker restart.) Is this right? Is there any way on Docker for Windows to store a large amount of data (20-40GB) inside the docker image? (I know this is bad form, but for my particular use case, it is unfortunately required…)

Please advise, thanks.


Adding this to the daemon.json file worked for me:

“storage-opts” : [ “size=40G” ]

Complete file:

“storage-opts” : [ “size=40G” ]

I got the exact same error as alexlex:

System error 1067 has occurred.

on Windows 2019.

I had this in C:\ProgramData\docker\config\deamon.json:

“storage-opts”: [

I deleted the deamon.json file (obviously check if you have other relevant settings in the file you don’t want to loose) and then I was able to reconfigure as Michael Friis describes (on my Powershell prompt I had issues with .\dockerd and it seems like there is a missing dash in storage-opt in Michael’s example). What worked on my machine was:

net stop docker
dockerd --unregister-service
dockerd --register-service --storage-opt size=30G
net start docker