Created
March 26, 2018 05:03
-
-
Save mickgeek/3bf73f18908bbbff09e8d88bd8e623f0 to your computer and use it in GitHub Desktop.
swap + docker
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
swap space (https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-16-04) | |
---------- | |
fallocate -l 1G /swapfile | |
chmod 600 /swapfile | |
mkswap /swapfile | |
swapon /swapfile | |
nano /etc/fstab | |
... | |
/swapfile none swap sw 0 0 | |
nano /etc/sysctl.conf | |
... | |
vm.swappiness = 10 | |
vm.vfs_cache_pressure = 50 | |
vm.overcommit_memory = 2 | |
vm.overcommit_ratio = 100 | |
shutdown -r now | |
docker | |
------ | |
curl -sSL get.docker.com -o docker-setup.sh | |
sh docker-setup.sh | |
rm docker-setup.sh | |
nano /etc/default/grub | |
GRUB_CMDLINE_LINUX="... cgroup_enable=memory swapaccount=1" | |
update-grub | |
shutdown -r now | |
curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose | |
chmod +x /usr/local/bin/docker-compose | |
cp /srv/docker/docker-compose-app.service /etc/systemd/system/ | |
systemctl enable docker-compose-app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment