0

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.

Irshad Ali
  • 1,153
  • 1
  • 13
  • 39
  • Does this answer your question ? https://stackoverflow.com/questions/30604846/docker-error-no-space-left-on-device – ESCoder May 07 '20 at 03:41
  • @bhavya Actually it talks about only how to clear memory from what is already available to docker and consumed by .... – Irshad Ali May 07 '20 at 04:23
  • Memory (as reported by `free`) and disk (as reported by `df`) are two different resources; you can have lots of free memory but no disk space remaining, and _vice versa_. If you're trying to pull a very large Docker image the situation you report could easily happen. – David Maze May 07 '20 at 10:43
  • @David oh! yes you are right! but now i would ask how to make use of disk space if memory is not enough. – Irshad Ali May 07 '20 at 14:42

1 Answers1

0

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

Irshad Ali
  • 1,153
  • 1
  • 13
  • 39