Skip to content

Instantly share code, notes, and snippets.

@x-projs
Last active December 9, 2020 15:35
Show Gist options
  • Save x-projs/7ed83ff3cbab5f370e78a61b16872066 to your computer and use it in GitHub Desktop.
Save x-projs/7ed83ff3cbab5f370e78a61b16872066 to your computer and use it in GitHub Desktop.
ubuntu-init.sh
# Create swap file
sudo fallocate -l 1G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' >> /etc/fstab
sudo apt update
sudo apt dist-upgrade -y
sudo apt install -y docker.io
sudo systemctl enable --now docker
echo "alias d='sudo docker'" >> ~/.profile
echo "alias dr='d run -p 80:80 -p 443:443 -d --restart always'" >> ~/.profile
source ~/.profile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment