Skip to content
This repository has been archived by the owner on Dec 1, 2018. It is now read-only.

Commit

Permalink
Merge pull request #68 from blinkreaction/develop
Browse files Browse the repository at this point in the history
Release v1.4.0
  • Loading branch information
Leonid Makarov committed Jan 20, 2016
2 parents 5d972d2 + 193fded commit 8b8c8c1
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 41 deletions.
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# Changelog

## 1.4.0 (2016-01-20)

- Version updates
- Switched to blinkreaction/boot2docker base box v1.9.1
- docker 1.9.1
- docker-compose 1.5.2
- Set NFS attribute caching of files and directories to 2 seconds
- This will make sure delays in file system updates detection is within 2s.
- Prevent permission (chmod) errors on SMB share
- Updates in install scripts
- Brew Cask is now part of Brew
- Point DOCKER_HOST to 192.168.10.10 instead of localhost for better performance with Intel adapters and NAT
- Suppress errors from VBoxManage on Windows
- Improved messaging in setup scripts

## 1.3.1 (2015-11-16)

- Remove /cygdrive prefix
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.1
1.4.0
6 changes: 3 additions & 3 deletions Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ Vagrant.configure("2") do |config|
config.vm.define "boot2docker"

config.vm.box = "blinkreaction/boot2docker"
config.vm.box_version = "1.9.0"
config.vm.box_version = "1.9.1"
config.vm.box_check_update = true

## Network ##
Expand Down Expand Up @@ -132,7 +132,7 @@ Vagrant.configure("2") do |config|
@ui.success "Using nfs2 synced folder option"
config.vm.synced_folder vagrant_root, vagrant_mount_point,
type: "nfs",
mount_options: ["nolock", "noacl", "nocto", "noatime", "nodiratime", "vers=3", "tcp"]
mount_options: ["nolock", "noacl", "nocto", "noatime", "nodiratime", "vers=3", "tcp", "actimeo=2"]
config.nfs.map_uid = Process.uid
config.nfs.map_gid = Process.gid
# smb: Better performance on Windows. Requires Vagrant to be run with admin privileges.
Expand Down Expand Up @@ -164,7 +164,7 @@ Vagrant.configure("2") do |config|
config.vm.provision "shell", run: "always" do |s|
s.inline = <<-SCRIPT
mkdir -p vagrant $2
mount -t cifs -o uid=`id -u docker`,gid=`id -g docker`,sec=ntlm,username=$3,pass=$4,dir_mode=0777,file_mode=0777 //$5/$1 $2
mount -t cifs -o uid=`id -u docker`,gid=`id -g docker`,noperm,sec=ntlm,username=$3,pass=$4,dir_mode=0777,file_mode=0777 //$5/$1 $2
SCRIPT
s.args = "#{vagrant_folder_name} #{vagrant_mount_point} #{$vconfig['synced_folders']['smb_username']} #{$vconfig['synced_folders']['smb_password']} #{host_ip}"
end
Expand Down
28 changes: 14 additions & 14 deletions scripts/presetup-mac.sh
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
#!/bin/bash

DOCKER_VERSION=1.9.0
DOCKER_COMPOSE_VERSION=1.5.0
DOCKER_VERSION=1.9.1
DOCKER_COMPOSE_VERSION=1.5.2

# Console colors
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[1;33m'
NC='\033[0m'

echo-red () { echo -e "${red}$1${NC}"; }
echo-green () { echo -e "${green}$1${NC}"; }
echo-yellow () { echo -e "${yellow}$1${NC}"; }

# Homebrew installation
echo -e "${green}Installing Homebrew...${NC}"
echo-green "Installing Homebrew..."
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

# Cask installation
echo -e "${green}Installing Cask...${NC}"
brew install caskroom/cask/brew-cask

# Update brew formulae
echo -e "${green}Updating brew formulae...${NC}"
echo-green "Updating brew formulae..."
brew update

# VirtualBox installation
echo -e "${green}Installing virtualbox...${NC}"
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
VBoxManage hostonlyif remove vboxnet0
VBoxManage dhcpserver remove --netname HostInterfaceNetworking-vboxnet0 > /dev/null 2>&1
VBoxManage hostonlyif remove vboxnet0 > /dev/null 2>&1

# Vagrant installation
echo -e "${green}Installing vagrant...${NC}"
echo-green "Installing vagrant..."
brew cask install vagrant

# Install docker
echo -e "${green}Installing docker...${NC}"
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

# Install docker-compose
echo -e "${green}Installing docker-compose...${NC}"
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
8 changes: 4 additions & 4 deletions scripts/presetup-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

DOCKER_VERSION=1.9.0
DOCKER_COMPOSE_VERSION=1.5.0
DOCKER_VERSION=1.9.1
DOCKER_COMPOSE_VERSION=1.5.2

#-------------------------- Helper functions --------------------------------

Expand Down Expand Up @@ -36,13 +36,13 @@ if [[ $lsb_dist != 'Ubuntu' || $lsb_release < '14.04' ]]; then
exit 1
fi

echo-green "Installing Docker..."
echo-green "Installing Docker v${DOCKER_VERSION}..."
curl -sSL https://get.docker.com/ | sh && \
sudo usermod -aG docker $(whoami) && \
sudo docker version
if_failed "Docker installation/upgrade failed."

echo-green "Installing Docker Compose..."
echo-green "Installing Docker Compose v{DOCKER_COMPOSE_VERSION}..."
sudo curl -L 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 && \
docker-compose --version
Expand Down
31 changes: 22 additions & 9 deletions scripts/presetup-win.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,43 @@
#!/bin/bash

DOCKER_VERSION=1.9.0
DOCKER_COMPOSE_VERSION=1.5.0
DOCKER_VERSION=1.9.1
DOCKER_COMPOSE_VERSION=1.5.2

# Console colors
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[1;33m'
NC='\033[0m'

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 -e "${red}[b2d-setup] testing mode: environment = \"${B2D_BRANCH}\"$NC"
echo-red "[b2d-setup] testing mode: environment = ${B2D_BRANCH}"
else
B2D_BRANCH='master'
fi

# Install prerequisites via choco (virtualbox and vagrant)
curl -L https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/scripts/presetup-win.cmd -o $WINDIR/Temp/presetup-win.cmd
curl -L https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/scripts/presetup-win.vbs -o $WINDIR/Temp/presetup-win.vbs
echo "Setup needs administrator privileges to contiue..."
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

# Install Docker
curl -L https://get.docker.com/builds/Windows/i386/docker-$DOCKER_VERSION.exe -o /usr/local/bin/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
chmod +x /usr/local/bin/docker

# Install Docker Compose
curl -L https://github.com/docker/compose/releases/download/$DOCKER_COMPOSE_VERSION/docker-compose-Windows-x86_64.exe > /usr/local/bin/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 > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

# Git settings
echo "Adjusting git defaults"
echo-green "Adjusting git defaults..."
git config --global core.autocrlf input
git config --system core.longpaths true
27 changes: 17 additions & 10 deletions scripts/setup.sh
Original file line number Diff line number Diff line change
@@ -1,58 +1,65 @@
#!/bin/bash

# Docker Host IP
DOCKER_HOST_IP='192.168.10.10'

# Console colors
red='\033[0;31m'
green='\033[0;32m'
yellow='\033[1;33m'
NC='\033[0m'

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 -e "${red}[b2d-setup] testing mode: environment = \"${B2D_BRANCH}\"$NC"
echo-red "[b2d-setup] testing mode: environment = ${B2D_BRANCH}"
else
B2D_BRANCH='master'
fi

# Download Vagrantfile
echo -e "${green}Downloading Vagrantfile into the current directory...${NC}"
echo-green "Downloading Vagrantfile into the current directory..."
curl -sO "https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/Vagrantfile"

# Download vagrant.yml
echo -e "${green}Downloading vagrant.yml into the current directory...${NC}"
echo-green "Downloading vagrant.yml into the current directory..."
curl -sO "https://raw.githubusercontent.com/blinkreaction/boot2docker-vagrant/${B2D_BRANCH}/vagrant.yml"

# Write DOCKER_HOST variable export to a matching .rc file based on the shell (bash or zsh)
SOURCE_FILE=''
DOCKER_HOST_EXPORT='\n# Docker (default for Vagrant based boxes)\nexport DOCKER_HOST=tcp://localhost:2375\n'
DOCKER_HOST_EXPORT="\n# Docker (default for Vagrant based boxes)\nexport DOCKER_HOST=tcp://${DOCKER_HOST_IP}:2375\n"

# Detect shell to write to the right .rc file
if [[ $SHELL == '/bin/bash' || $SHELL == '/bin/sh' ]]; then SOURCE_FILE=".bash_profile"; fi
if [[ $SHELL == '/bin/zsh' ]]; then SOURCE_FILE=".zshrc"; fi

if [[ $SOURCE_FILE ]]; then
# See if we already did this and skip if so
grep -q "export DOCKER_HOST=tcp://localhost:2375" $HOME/$SOURCE_FILE
grep -q "export DOCKER_HOST=tcp://${DOCKER_HOST_IP}:2375" $HOME/$SOURCE_FILE
if [[ $? -ne 0 ]]; then
echo -e "${green}Adding automatic DOCKER_HOST export to $HOME/$SOURCE_FILE${NC}"
echo-green "Adding automatic DOCKER_HOST export to $HOME/$SOURCE_FILE"
echo -e $DOCKER_HOST_EXPORT >> $HOME/$SOURCE_FILE
fi
else
echo -e "${red}Cannot detect your shell. Please manually add the following to your respective .rc or .profile file:${NC}"
echo-red "Cannot detect your shell. Please manually add the following to your respective .rc or .profile file:"
echo -e "$DOCKER_HOST_EXPORT"
fi

if [[ $B2D_NO_AUTOSTART == '' ]]; then
# Start the boot2docker VM
echo -e "${green}Starting the boot2docker VM...${NC}"
echo-green "Starting the boot2docker VM..."
vagrant up

# Check that Docker works
echo -e "${green}Checking that everything is in place...${NC}"
echo-green "Checking that everything is in place..."
docker version && vagrant ssh -c 'docker-compose --version'
if [[ $? -ne 0 ]]; then
echo -e "${red}Something went wrong. Please review console output for possible clues.${NC}"
exit 1
else
echo -e "${green}Docker Host is up and running. Please restart your shell.${NC}"
echo-green "Docker Host is up and running. Please restart your shell."
fi
fi

0 comments on commit 8b8c8c1

Please sign in to comment.