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% /
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.
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?
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
I have had hell understanding the resize2fs.
that’s how I got it working :
First, my context is as follow :
I store my container’s volume in a file image.
Then I try to resize it.
#make a 2GB file that will be used as a filesystem
truncate -s 2G my_fs
# format file as an ext4 filesystem
mkfs.ext4 ./my_fs
# mount the filesystem in my_dir
mkdir ./my_dir
sudo mount -o loop ./my_fs ./my_dir
my_dir can now be mounted in a docker container using the volume option
if the container is running out of space
pause the container with docker container pause 0123456789
first, find the loop device where my_dir is mounted: lsblk
then
#add 3GB to the filesystem
truncate -s +3G
sudo partprobe -s /dev/loop0
sudo losetup -c /dev/loop0
# check the size of the partition :
sudo fdisk -l /dev/loop0
#resize the filesystem :
sudo resize2fs /dev/loop0
#check the new size
df -h /dev/loop0
#voila !!
now unpause the container with docker container unpause 0123456789