Skip to content

Instantly share code, notes, and snippets.

@istepanov
Created May 24, 2017 03:29
Show Gist options
  • Save istepanov/ac32ce9847cab76c23c262c9073799fb to your computer and use it in GitHub Desktop.
Save istepanov/ac32ce9847cab76c23c262c9073799fb to your computer and use it in GitHub Desktop.
Install Docker, Docker Compose and NTP
#!/bin/bash
# stop execution if error
set -e
export DEBIAN_FRONTEND=noninteractive
# pre-requirements
apt-get update
apt-get upgrade -y
apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
# add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# verify that the key fingerprint is 9DC8 5822 9FC7 DD38 854A E2D8 8D81 803C 0EBF CD88
apt-key fingerprint 0EBFCD88
# add Docker repo
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# update the apt package index
apt-get update
# install Docker Community Edition
apt-get install -y docker-ce
# allow user 'ubuntu' to manage Docker
usermod -aG docker ubuntu
# install Docker Compose
curl -L https://github.com/docker/compose/releases/download/1.13.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
# ntp daemon will periodically keep any clock drift in check
apt-get -y install ntp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment