How to use disk space when memory is not enough to pull docker image

418 Views Asked by At

I am trying to pull a docker image that says: write /var/lib/docker/tmp/GetImageBlob375213140: no space left on device

Insight: $sudo docker info Total Memory: 7.544GiB

[ec2-user@ip-172-31-93-184 ~]$ df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        3.8G     0  3.8G   0% /dev
tmpfs           3.8G     0  3.8G   0% /dev/shm
tmpfs           3.8G  444K  3.8G   1% /run
tmpfs           3.8G     0  3.8G   0% /sys/fs/cgroup
/dev/nvme0n1p1   24G  7.9G   17G  33% /
tmpfs           773M     0  773M   0% /run/user/1000
[ec2-user@ip-172-31-93-184 ~]$ free -h
              total        used        free      shared  buff/cache   available
Mem:           7.5G        189M        7.1G        456K        309M        7.1G
Swap:            0B          0B          0B

How could i use disk space? I think it has something to do with Swap.

Please let me know if any other info could help in understanding the issue. Thanks in advance.

1

There are 1 best solutions below

0
On

Below are the command could be used to add swap space from hard disk.

$ sudo fallocate -l 1g /mnt/1GiB.swap
$ sudo chmod 600 /mnt/1GiB.swap
$ sudo mkswap /mnt/1GiB.swap
#  Setting up swapspace version 1, size = 1048576 kB
$ sudo swapon /mnt/1GiB.swap

Ref: https://help.ubuntu.com/community/SwapFaq