Last active
November 25, 2019 10:33
-
-
Save VictorGob/38b7a0ad118eca7698e9ab50a4d7dfa2 to your computer and use it in GitHub Desktop.
Bash script: install docker and docker-compose
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
#!/bin/bash | |
echo "Installing Docker!" | |
sudo apt update | |
sudo apt install -y \ | |
sudo apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg-agent \ | |
software-properties-common jq | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
sudo apt update | |
sudo apt install -y docker-ce docker-ce-cli containerd.io #docker-compose | |
VERSION=$(curl --silent https://api.github.com/repos/docker/compose/releases/latest | jq .name -r) | |
sudo curl -L https://github.com/docker/compose/releases/download/${VERSION}/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
sudo usermod -a -G docker $USER | |
docker --version && docker-compose --version | |
echo "Log out if error and relog" | |
echo "Docker, docker-compose installed!!!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment