Last active
December 10, 2018 16:53
-
-
Save kyletaylored/24d1291120f7cea4bcddf52a85c5bef6 to your computer and use it in GitHub Desktop.
Docksal swap file command to increase swap size for Composer issues (beta)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -e # Abort if anything fails | |
echo "Checking current swap space..." | |
fin exec free -h | |
# Increase swap memory | |
echo "Creating 512M swap file..." | |
fin exec sudo dd if=/dev/zero of=/swapfile bs=1M count=512 | |
echo "Formatting swap file..." | |
fin exec sudo mkswap /swapfile | |
fin exec sudo chown root /swapfile | |
fin exec sudo chmod 0600 /swapfile | |
# echo "Adding swap to /etc/fstab..." | |
# fin exec sudo echo "/swap swap swap defaults 0 0" >> /etc/fstab | |
# fin exec echo "/swap none swap sw 0 0" | sudo tee -a /etc/fstab | |
echo "Enabling swap..." | |
fin exec sudo swapon /swapfile -a | |
echo "Checking new swap space..." | |
fin exec free -h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fstab doesn't look like it's available on these docker containers, so the command errors out.