docker-compose-files/hyperledger/1.0/scripts/setup_Docker.sh

30 lines
693 B
Bash
Raw Normal View History

2017-05-12 13:42:40 +08:00
#!/usr/bin/env bash
2017-06-08 17:30:33 +08:00
source scripts/header.sh
2017-05-10 11:56:47 +08:00
if [ xroot != x$(whoami) ]
then
2017-05-12 13:42:40 +08:00
echo_r "You must run as root (Hint: sudo su)"
2017-05-10 11:56:47 +08:00
exit
fi
apt-get update && apt-get install curl -y
2017-05-12 13:42:40 +08:00
echo_b "Install Docker..."
2017-05-10 11:56:47 +08:00
wget -qO- https://get.docker.com/ | sh
sudo service docker stop
nohup sudo docker daemon --api-cors-header="*" -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock&
2017-05-12 13:42:40 +08:00
echo_g "Docker Installation Done"
echo_b "Install Docker-Compose..."
2017-05-10 11:56:47 +08:00
curl -L https://github.com/docker/compose/releases/download/1.8.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker-compose --version
2017-05-12 13:42:40 +08:00
echo_g "Docker-Compose Installation Done"