Why is docker image eating up my disk space that is not used by docker

0 votes

I have setup docker and I have used completely different block device to store docker's system data:

[root@blink1 /]# cat /etc/sysconfig/docker
# /etc/sysconfig/docker
other_args="-H tcp://0.0.0.0:9367 -H unix:///var/run/docker.sock -g /disk1/docker"
Note that /disk/1 is using a completely different hard drive /dev/xvdi
Filesystem      Size  Used Avail Use% Mounted on
/dev/xvda1      7.8G  5.1G  2.6G  67% /
devtmpfs        1.9G  108K  1.9G   1% /dev
tmpfs           1.9G     0  1.9G   0% /dev/shm
/dev/xvdi        20G  5.3G   15G  27% /disk1
/dev/dm-1       9.8G  1.7G  7.6G  18% /disk1/docker/devicemapper/mnt/bb6c540bae25aaf01aedf56ff61ffed8c6ae41aa9bd06122d440c6053e3486bf
/dev/dm-2       9.8G  1.7G  7.7G  18% /disk1/docker/devicemapper/mnt/c85f756c59a5e1d260c3cdb473f3f4d9e55ac568967abe190eeaf9c4087afeac

The problem is that when I continue download docker images and run docker containers, it seems that the other hard drive /dev/xvda1 is also used up.

Jul 31, 2018 in Docker by Hannah
• 18,520 points
1,804 views

2 answers to this question.

0 votes

It's a kernel problem with devicemapper, which affects the RedHat family of OS (RedHat, Fedora, CentOS, and Amazon Linux). Deleted containers don't free up mapped disk space. This means that on the affected OSs you'll slowly run out of space as you start and restart containers.

uninstall docker, then delete all its files, then reinstall:

sudo yum remove docker
sudo rm -rf /var/lib/docker
sudo yum install docker
answered Jul 31, 2018 by Kalgi
• 52,350 points
0 votes

Move the /var/llib/docker directory.

Assuming the /root directory has enough room, if not, substitute for one that does,

sudo systemctl stop docker
mv /usr/lib/docker /root
ln -s /root/docker /var/lib/docker
systemctl start docker
answered Aug 6, 2018 by Nilesh
• 7,060 points

Related Questions In Docker

0 votes
1 answer

Why is my docker installation failing?

First off check if virtualbox is running; ...READ MORE

answered Jul 31, 2018 in Docker by Sophie may
• 10,620 points
587 views
0 votes
0 answers

Why is Docker installed but not Docker Compose?

By using the commands below, I was ...READ MORE

Apr 21, 2022 in Docker by pranav
• 2,590 points
1,523 views
+1 vote
4 answers

COPY is not working in Docker

I had the exact same issue. I ...READ MORE

answered May 6, 2019 in Docker by Emilia
22,438 views
+2 votes
1 answer
+2 votes
1 answer

Deploy Docker Containers from Docker Cloud

To solve this problem, I followed advice ...READ MORE

answered Sep 3, 2018 in AWS by Priyaj
• 58,020 points
2,739 views
0 votes
7 answers

docker: executable file not found in $PATH

try to build the image with --no-cache. I ...READ MORE

answered Nov 1, 2020 in Docker by Deeptesh Agrawal
62,807 views
+1 vote
1 answer

How to push a docker image to a private repository

You need to tag your image correctly ...READ MORE

answered Jul 26, 2018 in Docker by Kalgi
• 52,350 points
2,296 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP