If you run
docker pull, and you see an error like
failed to register layer: Error processing tar file(exit status 2): fatal error: runtime: out of memory, there could be 2 reasons.
Obvious one — not enough disk space for docker. You can fix it with
docker system prune -af
docker volume ls -qf dangling=true
WARNING: It will remove your unused resources like images and volumes for the containers that are not running at the moment.
Not that obvious one: if you are using swap file, your swap file can be full.
You can check it with one of the commands:
sudo swapon --show
# NAME TYPE SIZE USED PRIO
# /swapfile file 1024M 1023.8M -2
# it could be like
# Swap: 1023 1023 0
It means you need to increase it.
Here is the article on how to do it — https://blog.bullgare.com/2022/06/how-to-add-and-increase-swap-on-centos/