Created
September 3, 2016 08:06
-
-
Save fud/9d925facca6b94c47b5a8d969cb47122 to your computer and use it in GitHub Desktop.
More swap space for a docker machine.
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
for i in $(docker-machine ls | 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 |
@arvindkumarc and googlers you can use dd instead of fallocate:
# dd if=/dev/zero of=/swapfile bs=1M count=512
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
boot2docker complains about
fallocate
not being present, any idea how to overcome this?