Skip to content

Instantly share code, notes, and snippets.

@thomas15v
Last active August 7, 2018 10:54
Show Gist options
  • Save thomas15v/c42470bf97106c171dcc3ea08461d53b to your computer and use it in GitHub Desktop.
Save thomas15v/c42470bf97106c171dcc3ea08461d53b to your computer and use it in GitHub Desktop.
Install docker on ubuntu
curl -s https://gist.githubusercontent.com/thomas15v/c42470bf97106c171dcc3ea08461d53b/raw/18597cb816de04350e0266ae5ab7f37cba18aeb7/install.sh | bash
# install docker
sudo apt-get update
sudo apt-get install -y \
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 \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install -y docker-ce
# install docker-compose
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
sudo curl -L https://github.com/docker/compose/releases/download/$(get_latest_release docker/compose)/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment