Last active
August 29, 2015 14:16
Revisions
-
thetechnick renamed this gist
Mar 10, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
thetechnick created this gist
Mar 10, 2015 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,86 @@ #!/bin/sh # # Common # print() { reset='\033[0m' case $2 in info) color='\033[0;34m';; success) color='\033[0;32m';; error) color='\033[0;31m';; warning) color='\033[0;33m';; esac echo -e "${color}${1}${reset}" } error() { print "$1" error exit 1 } # # Docker # echo "CentOS Docker installer/updater" echo "Installing/Updating docker" if which docker > /dev/null; then print "Docker already installed - skipping ..." success else print "Installing docker ..." info yum install -y docker if [ $? -ne 0 ] then error "Error while installing docker" fi fi # # Download # print "Downloading binaries and support files ..." info if [ -f 'docker-latest.tgz' ] then print "-> binaries found locally!" success else print "-> downloading binaries ..." info wget https://get.docker.com/builds/Linux/x86_64/docker-latest.tgz fi if [ -f 'docker.socket' ] then print "-> docker.socket found locally!" success else print "-> downloading docker.sock ..." info wget https://raw.githubusercontent.com/docker/docker/master/contrib/init/systemd/docker.socket fi if [ -f 'docker.service' ] then print "-> docker.service found locally!" success else print "-> downloading docker.service ..." info wget https://raw.githubusercontent.com/docker/docker/master/contrib/init/systemd/docker.service fi print "Binaries downloaded successfully" success # # Install # echo print "Installing binaries ..." info tar -zxf docker-latest.tgz cp ./usr/local/bin/docker /usr/bin/ cp -u docker.* /etc/systemd/system rm -rf ./usr print "Binaries installed successfully" success print "Docker installed successfully" success print "Use 'service docker restart' to start the docker daemon" success