Skip to content

Instantly share code, notes, and snippets.

@GMory
Created January 30, 2019 15:37
Show Gist options
  • Save GMory/6978a47a92414f526d2a52cfeff2a3a7 to your computer and use it in GitHub Desktop.
Save GMory/6978a47a92414f526d2a52cfeff2a3a7 to your computer and use it in GitHub Desktop.
Install docker and docker-compose on a fresh Ubuntu 16.04/16.10/18.04/18.10 box
#!/bin/bash
echo "Installing docker..."
sudo apt update
sudo apt -y install apt-transport-https ca-certificates curl software-properties-common
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 bionic stable"
sudo apt update
apt-cache policy docker-ce
sudo apt -y install docker-ce
sudo systemctl status docker
sudo usermod -aG docker ${USER}
echo "Installing docker compose..."
sudo curl -L https://github.com/docker/compose/releases/download/1.18.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
echo "Installation complete. Please logout of the server then back in."
@GMory
Copy link
Author

GMory commented Dec 29, 2019

  1. wget https://gist.githubusercontent.com/GMory/6978a47a92414f526d2a52cfeff2a3a7/raw/5c2b431feeb2ea340a35389db23862283493a4a2/install-docker.sh

  2. bash install-docker.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment