Last active
April 27, 2020 09:49
-
-
Save andybeak/6f623ad339ef0d212e0bf7b38c46abdf to your computer and use it in GitHub Desktop.
Get AWS Ubuntu Linux VM ready for remote development #book #course
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
#!/bin/bash | |
sudo apt update && sudo apt upgrade -y | |
if ! lsb_release -r -s | grep -q '18.04'; then | |
echo "Please use Ubuntu 18.04 LTS"; | |
exit; | |
fi | |
echo "---- Installing dependencies" | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg-agent \ | |
software-properties-common | |
echo "---- Fetching docker publisher key" | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
echo "---- Adding docker repository" | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
echo "---- Fetching package information from docker repository" | |
sudo apt-get update | |
echo "---- Installing docker" | |
sudo apt-get install -y \ | |
docker-ce \ | |
docker-ce-cli \ | |
containerd.io | |
echo "---- Configuring docker to start at boot" | |
sudo systemctl enable docker | |
echo "---- Installing docker-compose" | |
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
echo "---- Installing PHP" | |
sudo apt-get install -y php7.2-cli unzip php7.2-zip php7.2-dom php7.2-curl php7.2-mbstring php7.2-xml | |
echo "---- Installing PHP composer" | |
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
sudo php composer-setup.php --install-dir=/usr/local/bin --filename=composer | |
php -r "unlink('composer-setup.php');" | |
echo "---- Enabling current user to use docker" | |
sudo usermod -aG docker $USER | |
newgrp docker | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment