How to increase docker disk image size in Ubuntu

前端 未结 1 896
予麋鹿
予麋鹿 2021-01-21 08:57

I am trying to increase the docker image size on ubuntu. When I do docker info I get following info

Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Se         


        
相关标签:
1条回答
  • 2021-01-21 09:24

    Docker, on Linux, with the overlay2 storage driver, uses all of the host system's disk (and memory). There's no way to make it use less disk (without repartitioning your main system disk) and no way to give it more (without adding new hardware).

    Docker for Mac, the Linux-flavored Docker for Windows, and Docker Machine all work by launching virtual machines that run a minimal Linux OS. That VM has a specific disk and memory allocation and there's UI controls for it, but it's because the containers are running on a different OS and need an actual virtualization layer.

    On Linux, Docker also supports several storage drivers. These require varying amounts of Linux kernel support. Early versions of Docker used something called devicemapper which worked by allocating space in (most often) a fixed-size file, and then the dm.basesize option you give matters ("dm" is for "devicemapper"). Current versions of Docker on current versions of Linux use a different driver called overlay2 which just stores image and container content in ordinary directories. You still need kernel support for it but there's no reserved or limited disk space. That's also why the only size number in the docker info output is memory, which is a different resource.

    0 讨论(0)
提交回复
热议问题