Created
May 11, 2015 19:52
-
-
Save nerdalert/9af19d239aac39c8cdc2 to your computer and use it in GitHub Desktop.
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/sh | |
# Must have boot2docker installed if using Mac OS X | |
installMachineMac() { | |
sudo wget --no-check-certificate -O /usr/local/bin/docker-machine http://docker-machine-builds.evanhazlett.com/latest/docker-machine_darwin_amd64 | |
sudo chmod +x /usr/local/bin/docker-machine | |
} | |
installDockerBinMac(){ | |
sudo wget --no-check-certificate -O /usr/local/bin/docker https://get.docker.com/builds/Darwin/x86_64/docker-latest | |
sudo chmod +x /usr/local/bin/docker | |
} | |
installCompose(){ | |
sudo wget --no-check-certificate https://github.com/docker/compose/releases/download/1.2.0/docker-compose-`uname -s`-`uname -m` | |
sudo mv docker-compose-`uname -s`-`uname -m` /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
} | |
linuxDeps(){ | |
sudo apt-get update && sudo apt-get install -y wget curl | |
} | |
installDockerBinLinux(){ | |
sudo wget --no-check-certificate -qO- https://get.docker.com/ | sh | |
sudo usermod -aG docker `whoami` | |
} | |
# Installing case nightly build from a maintainer Evan | |
installMachineLinux() { | |
sudo wget --no-check-certificate -O /usr/local/bin/docker-machine https://docker-machine-builds.evanhazlett.com/latest/docker-machine_linux_amd64 | |
sudo chmod +x /usr/local/bin/docker-machine | |
} | |
UNAME=$(uname) | |
if [ "$UNAME" = "Darwin" ]; then | |
# Mac OS X platform | |
echo "-----> Mac OS X detected, checking dependencies" | |
if [ ! -f /usr/local/bin/boot2docker ]; then | |
echo "-----> Did not find boot2docker in /usr/local/bin/boot2docker, go to http://boot2docker.io to download and install it." | |
exit 1 | |
fi | |
echo "Boot2docker is installed, now pulling Mac OS X binaries" | |
if [ ! -f /usr/local/bin/docker ]; then | |
echo "-----> Downloading Docker Binary CLI (ensure boot2docker is installed if OSX, this is only tested on a MAC)..." | |
installDockerBinMac | |
fi | |
if [ ! -f /usr/local/bin/docker-machine ]; then | |
echo "-----> Downloading Docker Machine CLI..." | |
installMachineMac | |
fi | |
if [ ! -f /usr/local/bin/docker-compose ]; then | |
echo "-----> Downloading Docker Compose..." | |
installCompose | |
fi | |
elif [ "$UNAME" = "Linux" ]; then | |
# Linux platform | |
echo "Linux detected, checking dependencies" | |
if [ ! -f /usr/bin/wget ]; then | |
echo "-----> Downloading Docker Binary CLI (ensure boot2docker is installed if OSX, this is only tested on a MAC)..." | |
linuxDeps | |
fi | |
echo "-----> Dependencies meet, now pulling Linux binaries" | |
if [ ! -f /usr/bin/docker ]; then | |
echo "-----> Downloading Docker Binary CLI (ensure boot2docker is installed if OSX, this is only tested on a MAC)..." | |
installDockerBinLinux | |
fi | |
if [ ! -f /usr/local/bin/docker-machine ]; then | |
echo "-----> Downloading Docker Machine CLI..." | |
installMachineLinux | |
fi | |
if [ ! -f /usr/local/bin/docker-compose ]; then | |
echo "-----> Downloading Docker Compose..." | |
installCompose | |
fi | |
else | |
echo "-----> Unknown OS: $UNAME" | |
exit 1 | |
fi | |
echo "Verify you see a version for each binary below (docker, macine, compose)" | |
echo "Compose and Machine are development HEAD builds with latest patches/features" | |
echo "Docker version -----> " $(docker -v) | |
echo "Docker Machine version -----> " $(docker-machine -v) | |
echo "Docker Machine version -----> " $(docker-compose --version) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment