setup_env.sh 969 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/usr/bin/env bash
  2. # Install docker on Ubuntu/Debian system
  3. # Detecting whether can import the header file to render colorful cli output
  4. if [ -f ./header.sh ]; then
  5. source ./header.sh
  6. elif [ -f scripts/header.sh ]; then
  7. source scripts/header.sh
  8. else
  9. alias echo_r="echo"
  10. alias echo_g="echo"
  11. alias echo_b="echo"
  12. fi
  13. if [ xroot != x$(whoami) ]
  14. then
  15. echo_r "You must run as root (Hint: sudo su)"
  16. exit
  17. fi
  18. apt-get update && apt-get install curl -y
  19. echo_b "Install Docker..."
  20. wget -qO- https://get.docker.com/ | sh
  21. sudo service docker stop
  22. nohup sudo docker daemon --api-cors-header="*" -H tcp://0.0.0.0:2375 -H unix:///var/run/docker.sock&
  23. echo_g "Docker Installation Done"
  24. echo_b "Install Docker-Compose..."
  25. curl -L https://github.com/docker/compose/releases/download/1.17.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
  26. chmod +x /usr/local/bin/docker-compose
  27. docker-compose --version
  28. echo_g "Docker-Compose Installation Done"