I was running into this error on my digitalocean box:
FATA Error: Untar fork/exec /usr/bin/docker: cannot allocate memory
The fix for me was to add swapspace. By default my digitalocean droplet didn’t come with any swap!
dd if=/dev/zero of=/root/myswapfile bs=1M count=1024 chmod 600 /root/myswapfile mkswap /root/myswapfile swapon /root/myswapfile