From 3d6f449938039fdb8fd5b9cc1cc4fe2e074ceef7 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 3 Jun 2016 14:08:25 -0400 Subject: [PATCH 1/5] Hotfix for downloading docker binary --- scripts/presetup-mac.sh | 6 ++++-- scripts/presetup-win.sh | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/presetup-mac.sh b/scripts/presetup-mac.sh index fbecd8d..1ce28a2 100755 --- a/scripts/presetup-mac.sh +++ b/scripts/presetup-mac.sh @@ -36,8 +36,10 @@ brew cask install vagrant sudo rm -f /usr/local/bin/docker >/dev/null 2>&1 || true # Install docker echo-green "Installing docker cli v${DOCKER_VERSION}..." -sudo curl -sSL "https://get.docker.com/builds/$(uname -s)/$(uname -m)/docker-$DOCKER_VERSION" -o /usr/local/bin/docker -sudo chmod +x /usr/local/bin/docker +curl -sSL "https://get.docker.com/builds/$(uname -s)/$(uname -m)/docker-$DOCKER_VERSION.tgz" +tar zxf docker-$DOCKER_VERSION.tgz +sudo mv docker/* /usr/local/bin +rm -rf docker-$DOCKER_VERSION* # Remove old docker-compose version sudo rm -f /usr/local/bin/docker-compose >/dev/null 2>&1 || true diff --git a/scripts/presetup-win.sh b/scripts/presetup-win.sh index de4c372..f1dc53c 100644 --- a/scripts/presetup-win.sh +++ b/scripts/presetup-win.sh @@ -32,8 +32,10 @@ cscript $WINDIR/Temp/presetup-win.vbs rm -f /usr/local/bin/docker >/dev/null 2>&1 || true # Install Docker echo-green "Installing docker cli v${DOCKER_VERSION}..." -curl -sSL https://get.docker.com/builds/Windows/i386/docker-$DOCKER_VERSION.exe -o /usr/local/bin/docker.exe -chmod +x /usr/local/bin/docker.exe +curl -sSL https://get.docker.com/builds/Windows/i386/docker-$DOCKER_VERSION.zip +unzip docker-$DOCKER_VERSION.zip +mv docker/* /usr/local/bin +rm -rf docker-$DOCKER_VERSION* # Remove old docker-compose version rm -f /usr/local/bin/docker-compose >/dev/null 2>&1 || true From 7c0b41b6182d4c62d24500e94184ef579f5baa1e Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 3 Jun 2016 14:24:14 -0400 Subject: [PATCH 2/5] Adding B2D_INSTALL_MODE switch This will allow partial installs: - full - install everything - vm - install virtual box and vagrant only - docker - install docker related and other dependencies --- scripts/presetup-mac.sh | 77 +++++++++++++++++++++------------------ scripts/presetup-win.sh | 80 +++++++++++++++++++++-------------------- 2 files changed, 84 insertions(+), 73 deletions(-) diff --git a/scripts/presetup-mac.sh b/scripts/presetup-mac.sh index 1ce28a2..7524778 100755 --- a/scripts/presetup-mac.sh +++ b/scripts/presetup-mac.sh @@ -13,37 +13,46 @@ echo-red () { echo -e "${red}$1${NC}"; } echo-green () { echo -e "${green}$1${NC}"; } echo-yellow () { echo -e "${yellow}$1${NC}"; } -# Homebrew installation -echo-green "Installing Homebrew..." -ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - -# Update brew formulae -echo-green "Updating brew formulae..." -brew update - -# VirtualBox installation -echo-green "Installing virtualbox..." -brew cask install virtualbox -# Kill the default adapter and DHCP server to avoid network issues down the road -VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnet0 > /dev/null 2>&1 -VBoxManage hostonlyif remove vboxnet0 > /dev/null 2>&1 - -# Vagrant installation -echo-green "Installing vagrant..." -brew cask install vagrant - -# Remove old docker version -sudo rm -f /usr/local/bin/docker >/dev/null 2>&1 || true -# Install docker -echo-green "Installing docker cli v${DOCKER_VERSION}..." -curl -sSL "https://get.docker.com/builds/$(uname -s)/$(uname -m)/docker-$DOCKER_VERSION.tgz" -tar zxf docker-$DOCKER_VERSION.tgz -sudo mv docker/* /usr/local/bin -rm -rf docker-$DOCKER_VERSION* - -# Remove old docker-compose version -sudo rm -f /usr/local/bin/docker-compose >/dev/null 2>&1 || true -# Install docker-compose -echo-green "Installing docker-compose v${DOCKER_COMPOSE_VERSION}..." -sudo curl -sSL "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose -sudo chmod +x /usr/local/bin/docker-compose +B2D_BRANCH="${B2D_BRANCH:-master}" +B2D_INSTALL_MODE="${B2D_INSTALL_MODE:-full}" + +# VirtualBox and Vagrant dependencies +if [[ "$B2D_INSTALL_MODE" == "full" ]] || [[ "$B2D_INSTALL_MODE" == "vm" ]] ; then + # Homebrew installation + echo-green "Installing Homebrew..." + ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + + # Update brew formulae + echo-green "Updating brew formulae..." + brew update + + # VirtualBox installation + echo-green "Installing virtualbox..." + brew cask install virtualbox + # Kill the default adapter and DHCP server to avoid network issues down the road + VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnet0 > /dev/null 2>&1 + VBoxManage hostonlyif remove vboxnet0 > /dev/null 2>&1 + + # Vagrant installation + echo-green "Installing vagrant..." + brew cask install vagrant +fi + +# Docker and other dependencies +if [[ "$B2D_INSTALL_MODE" == "full" ]] || [[ "$B2D_INSTALL_MODE" == "docker" ]] ; then + # Remove old docker version + sudo rm -f /usr/local/bin/docker >/dev/null 2>&1 || true + # Install docker + echo-green "Installing docker cli v${DOCKER_VERSION}..." + curl -sSL "https://get.docker.com/builds/$(uname -s)/$(uname -m)/docker-$DOCKER_VERSION.tgz" + tar zxf docker-$DOCKER_VERSION.tgz + sudo mv docker/* /usr/local/bin + rm -rf docker-$DOCKER_VERSION* + + # Remove old docker-compose version + sudo rm -f /usr/local/bin/docker-compose >/dev/null 2>&1 || true + # Install docker-compose + echo-green "Installing docker-compose v${DOCKER_COMPOSE_VERSION}..." + sudo curl -sSL "https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + sudo chmod +x /usr/local/bin/docker-compose +fi diff --git a/scripts/presetup-win.sh b/scripts/presetup-win.sh index f1dc53c..b1efe18 100644 --- a/scripts/presetup-win.sh +++ b/scripts/presetup-win.sh @@ -14,44 +14,46 @@ echo-red () { echo -e "${red}$1${NC}"; } echo-green () { echo -e "${green}$1${NC}"; } echo-yellow () { echo -e "${yellow}$1${NC}"; } -# For testing -if [ ! $B2D_BRANCH == "" ]; then - echo-red "[b2d-setup] testing mode: environment = ${B2D_BRANCH}" -else - B2D_BRANCH='master' +B2D_BRANCH="${B2D_BRANCH:-master}" +B2D_INSTALL_MODE="${B2D_INSTALL_MODE:-full}" + +# VirtualBox and Vagrant dependencies +if [[ "$B2D_INSTALL_MODE" == "full" ]] || [[ "$B2D_INSTALL_MODE" == "vm" ]] ; then + # Install prerequisites via choco (virtualbox and vagrant) + echo-green "Installing virtualbox and vagrant via choco..." + curl -sSL https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/scripts/presetup-win.cmd -o $WINDIR/Temp/presetup-win.cmd + curl -sSL https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/scripts/presetup-win.vbs -o $WINDIR/Temp/presetup-win.vbs + echo-yellow "Setup needs administrator privileges to contiue..." + cscript $WINDIR/Temp/presetup-win.vbs fi -# Install prerequisites via choco (virtualbox and vagrant) -echo-green "Installing virtualbox and vagrant via choco..." -curl -sSL https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/scripts/presetup-win.cmd -o $WINDIR/Temp/presetup-win.cmd -curl -sSL https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/scripts/presetup-win.vbs -o $WINDIR/Temp/presetup-win.vbs -echo-yellow "Setup needs administrator privileges to contiue..." -cscript $WINDIR/Temp/presetup-win.vbs - -# Remove old docker version -rm -f /usr/local/bin/docker >/dev/null 2>&1 || true -# Install Docker -echo-green "Installing docker cli v${DOCKER_VERSION}..." -curl -sSL https://get.docker.com/builds/Windows/i386/docker-$DOCKER_VERSION.zip -unzip docker-$DOCKER_VERSION.zip -mv docker/* /usr/local/bin -rm -rf docker-$DOCKER_VERSION* - -# Remove old docker-compose version -rm -f /usr/local/bin/docker-compose >/dev/null 2>&1 || true -# Install Docker Compose -echo-green "Installing docker-compose v${DOCKER_COMPOSE_VERSION}..." -curl -sSL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-Windows-x86_64.exe -o /usr/local/bin/docker-compose.exe -chmod +x /usr/local/bin/docker-compose.exe - -# Install winpty -echo-green "Installing winpty (console) v$WINPTY_VERSION..." -curl -sSL -O https://github.com/rprichard/winpty/releases/download/$WINPTY_VERSION/winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32.tar.gz -tar -xf winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32.tar.gz -mv winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32/bin/* /usr/local/bin -rm -rf winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32* - -# Git settings -echo-green "Adjusting git defaults..." -git config --global core.autocrlf input -git config --system core.longpaths true +# Docker and other dependencies +if [[ "$B2D_INSTALL_MODE" == "full" ]] || [[ "$B2D_INSTALL_MODE" == "docker" ]] ; then + # Remove old docker version + rm -f /usr/local/bin/docker >/dev/null 2>&1 || true + # Install Docker + echo-green "Installing docker cli v${DOCKER_VERSION}..." + curl -sSL https://get.docker.com/builds/Windows/i386/docker-$DOCKER_VERSION.zip + unzip docker-$DOCKER_VERSION.zip + mv docker/* /usr/local/bin + rm -rf docker-$DOCKER_VERSION* + + # Remove old docker-compose version + rm -f /usr/local/bin/docker-compose >/dev/null 2>&1 || true + # Install Docker Compose + echo-green "Installing docker-compose v${DOCKER_COMPOSE_VERSION}..." + curl -sSL https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-Windows-x86_64.exe -o /usr/local/bin/docker-compose.exe + chmod +x /usr/local/bin/docker-compose.exe + + # Install winpty + echo-green "Installing winpty (console) v$WINPTY_VERSION..." + curl -sSL -O https://github.com/rprichard/winpty/releases/download/$WINPTY_VERSION/winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32.tar.gz + tar -xf winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32.tar.gz + mv winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32/bin/* /usr/local/bin + rm -rf winpty-$WINPTY_VERSION-cygwin-2.4.1-ia32* + + # Git settings + echo-green "Adjusting git defaults..." + git config --global core.autocrlf input + git config --system core.longpaths true +fi From c1eb858c25862a3464d1fbc1d68ee59f1722bac8 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 3 Jun 2016 14:26:23 -0400 Subject: [PATCH 3/5] Fix curl output --- scripts/presetup-mac.sh | 2 +- scripts/presetup-win.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/presetup-mac.sh b/scripts/presetup-mac.sh index 7524778..9002ee7 100755 --- a/scripts/presetup-mac.sh +++ b/scripts/presetup-mac.sh @@ -44,7 +44,7 @@ if [[ "$B2D_INSTALL_MODE" == "full" ]] || [[ "$B2D_INSTALL_MODE" == "docker" ]] sudo rm -f /usr/local/bin/docker >/dev/null 2>&1 || true # Install docker echo-green "Installing docker cli v${DOCKER_VERSION}..." - curl -sSL "https://get.docker.com/builds/$(uname -s)/$(uname -m)/docker-$DOCKER_VERSION.tgz" + curl -sSL -O "https://get.docker.com/builds/$(uname -s)/$(uname -m)/docker-$DOCKER_VERSION.tgz" tar zxf docker-$DOCKER_VERSION.tgz sudo mv docker/* /usr/local/bin rm -rf docker-$DOCKER_VERSION* diff --git a/scripts/presetup-win.sh b/scripts/presetup-win.sh index b1efe18..b061dfc 100644 --- a/scripts/presetup-win.sh +++ b/scripts/presetup-win.sh @@ -33,7 +33,7 @@ if [[ "$B2D_INSTALL_MODE" == "full" ]] || [[ "$B2D_INSTALL_MODE" == "docker" ]] rm -f /usr/local/bin/docker >/dev/null 2>&1 || true # Install Docker echo-green "Installing docker cli v${DOCKER_VERSION}..." - curl -sSL https://get.docker.com/builds/Windows/i386/docker-$DOCKER_VERSION.zip + curl -sSL -O https://get.docker.com/builds/Windows/i386/docker-$DOCKER_VERSION.zip unzip docker-$DOCKER_VERSION.zip mv docker/* /usr/local/bin rm -rf docker-$DOCKER_VERSION* From b4e6fb6525283b98fa7b2618ace51c374098b577 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 3 Jun 2016 14:42:11 -0400 Subject: [PATCH 4/5] Update docs --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6618628..c8baa79 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,10 @@ For best result and a clean setup it is recommended to remove any previous versi Automatic **installation** and **updates** of prerequisites is available via the one-liners below. **Make sure to stop all VirtualBox VMs prior to performing updates.** +Note: If you already have brew/cask and necessary versions of VirtualBox and Vagrant installed, +prefer to install them manually or would like to not update these components automatically, +prefix the command with `B2D_INSTALL_MODE=docker `. + **Mac** Prerequisites are installed using **brew/cask** (brew and cask will be installed if missing). From eeade7b5383a3476fe6a438b0fc60413ce4c3f90 Mon Sep 17 00:00:00 2001 From: Leonid Makarov Date: Fri, 3 Jun 2016 14:53:11 -0400 Subject: [PATCH 5/5] Version bump --- CHANGELOG.md | 7 +++++++ VERSION | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ab1ee2c..7ec058c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## 1.6.1 (2016-06-03) + +- Hotfix for downloading new docker binary versions +- Added B2D_INSTALL_MODE switch +- Updated docs + + ## 1.6.0 (2016-06-03) - Switched to blinkreaction/boot2docker base box [v1.11.2](https://atlas.hashicorp.com/blinkreaction/boxes/boot2docker/versions/1.11.2) diff --git a/VERSION b/VERSION index ce6a70b..2eda823 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.6.0 \ No newline at end of file +1.6.1 \ No newline at end of file