添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

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:

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

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

    Kind regards,

    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.

    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:
    Error:
    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:
    Error:
    bash: .dockerd: command not found

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

    Michael,

    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:
    Docker Documentation – 15 Nov 18

    Increasing the Base Device Size on Docker Daemon Restart

    Sometime back I wrote a feature for docker to allow expanding Base device size on daemon restart. This feature has been included in Docker 1.10, so you can try it out now. Before we jump further into this article, I would like to point out that...

    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…
    docs.microsoft.com

    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.

    -james

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

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

    Complete file:

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

    System error 1067 has occurred.

    on Windows 2019.

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

    “storage-opts”: [
    “size=50GB”

    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

  • Docker Desktop for Mac(Intel Chip)
  • Docker Desktop for Mac(Apple Chip)
  • Docker Desktop for Windows
  • Docker Desktop for Linux
  •