Skip to content

Instantly share code, notes, and snippets.

@pzula
Last active August 29, 2015 14:22
Show Gist options
  • Save pzula/daf83f4e4e592ac6eda7 to your computer and use it in GitHub Desktop.
Save pzula/daf83f4e4e592ac6eda7 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash -x
VIRTUALBOX_DOWNLOAD_URL="http://download.virtualbox.org/virtualbox/4.3.28/VirtualBox-4.3.28-100309-OSX.dmg"
VIRTUALBOX_DOWNLOAD_PATH="/Users/$USER/Downloads/virtualbox.dmg"
VIRTUALBOX_INSTALLER_PKG="/Volumes/VirtualBox/VirtualBox.pkg"
VIRTUALBOX_INSTALLER_TARGET=/Volumes/Macintosh\ HD
DOCKER_DOWNLOAD_URL="https://get.docker.com/builds/Darwin/x86_64/docker-latest"
DOCKER_DOWNLOAD_PATH="/usr/local/bin/docker"
DOCKER_MACHINE_DOWNLOAD_URL="https://github.com/docker/machine/releases/download/v0.2.0/docker-machine_darwin-amd64"
DOCKER_MACHINE_DOWNLOAD_PATH="/usr/local/bin/docker-machine"
DOCKER_COMPOSE_DOWNLOAD_URL="https://github.com/docker/compose/releases/download/1.3.0rc1/docker-compose-Darwin-x86_64"
DOCKER_COMPOSE_DOWNLOAD_PATH="/usr/local/bin/docker-compose"
install_virtualbox () {
echo "Installing VirtualBox"
if [ ! -f "$VIRTUALBOX_DOWNLOAD_PATH" ]; then
curl -L -o "$VIRTUALBOX_DOWNLOAD_PATH" $VIRTUALBOX_DOWNLOAD_URL
fi
hdiutil attach $VIRTUALBOX_DOWNLOAD_PATH \
&& sudo installer -pkg $VIRTUALBOX_INSTALLER_PKG -target "$VIRTUALBOX_INSTALLER_TARGET"
}
install_docker () {
echo "Installing Docker"
if [ ! -f "$DOCKER_DOWNLOAD_PATH" ]; then
curl -L -o "$DOCKER_DOWNLOAD_PATH" $DOCKER_DOWNLOAD_URL
fi
chmod +x $DOCKER_DOWNLOAD_PATH
}
install_docker_machine () {
echo "Installing Docker Machine"
if [ ! -f "$DOCKER_MACHINE_DOWNLOAD_PATH" ]; then
curl -L -o $DOCKER_MACHINE_DOWNLOAD_PATH $DOCKER_MACHINE_DOWNLOAD_URL
fi
chmod +x $DOCKER_MACHINE_DOWNLOAD_PATH
}
install_docker_compose () {
echo "Installing Docker Compose"
if [ ! -f "$DOCKER_COMPOSE_DOWNLOAD_PATH" ]; then
curl -L -o $DOCKER_COMPOSE_DOWNLOAD_PATH $DOCKER_COMPOSE_DOWNLOAD_URL
fi
chmod +x $DOCKER_COMPOSE_DOWNLOAD_PATH
}
install_virtualbox
install_docker
install_docker_machine
install_docker_compose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment