diff --git a/CHANGELOG.md b/CHANGELOG.md index c64e330..6bae9a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/VERSION b/VERSION index 3a3cd8c..88c5fb8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3.1 +1.4.0 diff --git a/Vagrantfile b/Vagrantfile index 149ed17..0afc3fb 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -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 ## @@ -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. @@ -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 diff --git a/scripts/presetup-mac.sh b/scripts/presetup-mac.sh index d8edc49..2129fb8 100755 --- a/scripts/presetup-mac.sh +++ b/scripts/presetup-mac.sh @@ -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 # Console colors red='\033[0;31m' @@ -9,35 +9,35 @@ 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 diff --git a/scripts/presetup-ubuntu.sh b/scripts/presetup-ubuntu.sh index d231599..39f21ef 100644 --- a/scripts/presetup-ubuntu.sh +++ b/scripts/presetup-ubuntu.sh @@ -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 -------------------------------- @@ -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 diff --git a/scripts/presetup-win.sh b/scripts/presetup-win.sh index b135266..4e8bdda 100644 --- a/scripts/presetup-win.sh +++ b/scripts/presetup-win.sh @@ -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 diff --git a/scripts/setup.sh b/scripts/setup.sh index c3cd2c6..deb16a1 100755 --- a/scripts/setup.sh +++ b/scripts/setup.sh @@ -1,29 +1,36 @@ #!/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 @@ -31,28 +38,28 @@ 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