Composer can use a lot of memory to run. A docker container uses the swap file of it’ s host. To increase the swap file of the host run the following script:
sudo dd if=/dev/zero of=/swapfile bs=1M count=1024 sudo mkswap /swapfile sudo chmod 600 /swapfile sudo swapon /swapfile echo 'echo "/swapfile none swap defaults 0 0" >> /etc/fstab' | sudo sh |