Skip to content

Instantly share code, notes, and snippets.

@alvin2ye
Last active February 25, 2019 05:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alvin2ye/f48c7fe21c1f189b9b1b0f3b704d352e to your computer and use it in GitHub Desktop.
Save alvin2ye/f48c7fe21c1f189b9b1b0f3b704d352e to your computer and use it in GitHub Desktop.
install_docker_on_ubuntu_1606.bash
#!/bin/bash
# Must 64bit
uname -a | grep x86_64 || echo "must 64bit" || exit 0
DOCKER_COMPOPSE_VERSION=1.23.2
# install packages
apt-get update
apt-get install -y --no-install-recommends software-properties-common apt-transport-https ca-certificates curl
apt-get remove docker docker-engine docker.io
# install docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
apt-key fingerprint 0EBFCD88
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
apt-get install -y docker-ce
echo "====================="
docker --version
echo "---------------------"
# install docker-compose
curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/$DOCKER_COMPOPSE_VERSION/docker-compose-$(uname -s)-$(uname -m)"
chmod +x /usr/local/bin/docker-compose
echo "====================="
docker-compose -v
echo "---------------------"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment