Last active
May 18, 2018 15:38
-
-
Save alvin2ye/bae751c687978a3c790b8c53c30a751b to your computer and use it in GitHub Desktop.
ubuntu 16.04 install docker & docker-compose
This file contains hidden or 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 | |
DOCKER_COMPOPSE_VERSION=1.16.1 | |
# install packages | |
sudo apt-get update | |
sudo apt-get install -y --no-install-recommends software-properties-common apt-transport-https ca-certificates curl | |
sudo apt-get remove docker docker-engine docker.io | |
# install docker | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt-key fingerprint 0EBFCD88 | |
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 | |
echo "=====================" | |
docker --version | |
echo "---------------------" | |
# install docker-compose | |
sudo curl -o /usr/local/bin/docker-compose -L "https://github.com/docker/compose/releases/download/$DOCKER_COMPOPSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" | |
sudo chmod +x /usr/local/bin/docker-compose | |
echo "=====================" | |
docker-compose -v | |
echo "---------------------" | |
# intall nginx | |
sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 \ | |
--recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 \ | |
&& echo "deb http://nginx.org/packages/ubuntu xenial nginx" \ | |
> /etc/apt/sources.list.d/nginx-stable-xenial.list \ | |
&& apt-get update \ | |
&& apt-get install -y nginx | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment