Created
August 23, 2016 16:07
-
-
Save kampta/1846c118f69271fd17f5a2052a8e24ab to your computer and use it in GitHub Desktop.
Add swap space in all digitalocean docker-machines when you run out of them
This file contains hidden or 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
for i in $(docker-machine ls | grep digitalocean | awk '{print $1}'); do docker-machine ssh $i -- ls /swapfile || docker-machine ssh $i "fallocate -l 512M /swapfile && chmod 400 /swapfile && mkswap /swapfile" && docker-machine ssh $i "swapon /swapfile && echo '/swapfile none swap defaults 0 0' >> /etc/fstab" &>/dev/null; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment