Docker increases disk space

I have a docker running and it gives me a warning about disk space. How can I increase docker space and start again? (Same container)

Let's say I want to give as 15 GB.

+9
docker
Sep 09 '15 at 17:19
source share
4 answers

I assume that you are talking about disk space to run your containers.

Make sure you have enough space on any drive that you use for /var/lib/docker , which Docker uses by default. You can change it with the -g daemon option.

If you run out of space, you may need to redistribute your OS disks so that you have more than 15 GB. If you use boot2docker or docker-machine , you will have to increase the volume on your virtual machine. It will depend on what you use for virtualization (i.e. VirtualBox, VMware, etc.)

For example, if you use VirtualBox and docker-machine , you can start with something similar for a 40 gigabyte virtual machine.

 docker-machine create --driver virtualbox --virtualbox-disk-size "40000" default 
+10
Sep 09 '15 at 20:11
source share

To increase the space available for Docker, you will have to increase the size of the docker pool. If you follow

 lvs 

You will see the docker-pool logical volume and its size. If your docker pool is in the free space volume group, you can simply increase the LV docker pool

 lvextend -l 100%FREE <path_to_lv> # An example using this may looks like this: # lvextend -l 100%FREE /dev/VolGroup00/docker-pool 

You can find more docker disk tips here.

thank

0
Oct 24 '16 at 9:47
source share

Docker saves all layers / images in its file format (i.e. aufs) in the default directory / var / lib / docker.

If you get a warning about disk space due to docker, then there should be a lot of docker images, and you need to clear it.

If you have the opportunity to add disk space, you can create a separate partition with a large size and mount your / var / lib / docker, which will help you get rid of filling the root partition.

more information can be found here on docker storage management. http://www.scmtechblog.net/2016/06/clean-up-docker-images-from-local-to.html

0
Feb 27 '17 at 10:07 on
source share

I encountered a similar problem with my docker-vm (this is "alpine-linux" in VMware Fusion in OS X):

  write error: no space left on device alpinevm:/mnt/hgfs failed to build: .. no space left on device 

.. in the end, this guide helped me resize / expand the docker volume.

TL; DR:

1 - Check the size of the partition containing / var / lib / docker

 > df -h /dev/sda3 17.6G 4.1G 12.6G 25% /var/lib/docker 

find '/ dev / sdaN', where N is your partition for '/ var / lib / docker', in my case / dev / sda3

2. Close your virtual machine, go to "Virtual Machine Settings"> "Hard Disk (s)"> resize your "virtual_disk.vmdk" (or any other virtual disk of your machine), then click "Apply" ( see This Guide ) ..

3 - Install cfdisk and e2fsprogs-extra , which contains resize2fs

 > apk add cfdisk > apk add e2fsprogs-extra 

4 - Run cfdisk and resize / expand / dev / sda3

 > cfdisk Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 206847 204800 100M 83 Linux /dev/sda2 206848 4241407 4034560 1.9G 82 Linux swap / Solaris /dev/sda3 4241408 83886079 79644672 12.6G 83 Linux [Bootable] [ Delete ] [ Resize ] [ Quit ] [ Type ] [ Help ] [ Write ] [ Dump ] 

.. press down / up to select '/ dev / sda3'

.. press left / right / enter to select "Resize" → "Write" → "Exit"

5 - Run resize2fs to expand the / dev / sda3 file system

 > resize2fs /dev/sda3 

6 - check the changed volume

 > df -h /dev/sda3 37.3G 4.1G 31.4G 12% /var/lib/docker 
0
Aug 29 '19 at 13:23
source share



All Articles