Docker Community Forums

Share and learn in the Docker community.

Increase container volume(disk) size


(Gugan K) #1

Hi,

Can someone please let me know how to increase the volume(disk) size of container ?.

Once I deployed the container, I just look at the disk space allocated to docker. Just 10GB has allocated to this. Is there any option to set the disk size to 100GB? . I have 1TB Hard disk size

[root@fa10q3907qab ~]# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 9.8G 878M 8.4G 10% /

Thanks.


(Gugan K) #2

Please someone help me on this. Still I’m wondering to get my problem resolved completely


(K3ck3c) #3

Read https://jpetazzo.github.io/2014/01/29/docker-device-mapper-resize/ and the more recent http://jpetazzo.github.io/assets/2015-03-03-not-so-deep-dive-into-docker-storage-drivers.html#1


(Sgibney) #4

With Centos 7 I did the following to increase the default size of the containers

Modify the docker config in /etc/sysconfig/docker-storage to add the line:
DOCKER_STORAGE_OPTIONS= - -storage-opt dm.basesize=20G
service docker stop
rm /var/lib/docker NOTE THIS DELETES ALL IMAGES etc. SO MAKE A BACKUP
service docker start
docker load < [each_save_in_backup.tar]
docker run -i -t [imagename] /bin/bash

In the bash prompt of the docker container “df -k” should show 20GB / file system size now.


(Carl J. Mosca) #5

With respect to resizing existing containers, I am not able to get the resize2fs command to succeed.

Can anyone shed additional light on this?


(Shekhar15) #6

I have installed docker on Linux machine. Then i pulled an image of Red Hat Linux 7. I tried the above approach but was unable to increase the size. Does anyone have any idea regarding this?


(Balav74) #7

I am wondering if you could give me some pointerss on a docker issue that I am facing. I am trying to increase the default fs size for containers created on OEL 7.1/docker 1.6.1 combination. I have tried setting

DOCKER_STORAGE_OPTIONS= --storage-opt dm.basesize=20G

in /etc/sysconfig/docker-storage

and also followed the instructions on the below link for reseting the sparse file size

https://jpetazzo.github.io/2014/01/29/docker-device-mapper-resize/

but even after the above, my ‘docker info’ is showing 'Data Space Total: 107.4 GB’ and new container’s default size is 10G. Any pointers?.


Docker container root disk default size (AWS ECS)
(Dvohra) #8

–storage-driver=devicemapper --storage-opt dm.basesize=20G


(Liwey) #9

No such file. No such file.


(Dvirarad) #10

Hi
I am using docker 17.05.0-c ubuntu 16.04
/etc/sysconfig/docker-storage this file does now exist

Does anyone know how to resize the docker volume?