diff --git a/CHANGELOG.md b/CHANGELOG.md index 36c8187..ab1ee2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 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) + - boot2docker/docker 1.11.2, docker-compose 1.7.1 +- Set `v.memory: 1024` by default +- System services + - New ssh-agent service + - Use the `stable` tag for vhost-proxy, dns, ssh-agent + - Bind all system services to `0.0.0.0` + - Run services with `--privileged --userns=host` (to give propper access to `docker.sock`) +- Remove `scripts/presetup-ubuntu.sh` +- Misc. imporvements in `presetup-mac.sh` and `presetup-win.sh` + ## 1.5.1 (2016-04-18) diff --git a/VERSION b/VERSION index 8e03717..ce6a70b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.5.1 \ No newline at end of file +1.6.0 \ No newline at end of file diff --git a/Vagrantfile b/Vagrantfile index 69903c7..e7ba124 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.10.3" + config.vm.box_version = "1.11.2" config.vm.box_check_update = true ## Network ## @@ -304,32 +304,37 @@ Vagrant.configure("2") do |config| end # System-wide dnsmasq service for DNS discovery and name resolution - # Image: blinkreaction/dns-discovery v1.0.0 - config.vm.provision "shell", run: "always", privileged: false do |s| + config.vm.provision "shell", privileged: false do |s| s.inline = <<-SCRIPT - echo "Starting system-wide DNS service... " - docker rm -f dns > /dev/null 2>&1 || true - docker run -d --name dns --label "group=system" \ - -p $1:53:53/udp -p 172.17.42.1:53:53/udp --cap-add=NET_ADMIN --dns 10.0.2.3 \ + echo "Setting up system-wide DNS service... " + docker run -d --name dns --label "group=system" --restart=always --privileged --userns=host \ + -p 53:53/udp --cap-add=NET_ADMIN --dns 10.0.2.3 \ -v /var/run/docker.sock:/var/run/docker.sock \ - blinkreaction/dns-discovery@sha256:f1322ab6d5496c8587e59e47b0a8b1479a444098b40ddd598e85e9ab4ce146d8 > /dev/null 2>&1 + blinkreaction/dns-discovery:stable > /dev/null 2>&1 + SCRIPT + end + + # System-wide ssh-agent service. + config.vm.provision "shell", privileged: false do |s| + s.inline = <<-SCRIPT + echo "Setting up system-wide ssh-agent service..." + docker run -d --name ssh-agent --label "group=system" --restart=always --privileged --userns=host \ + -v /var/run/docker.sock:/var/run/docker.sock \ + blinkreaction/ssh-agent:stable > /dev/null 2>&1 SCRIPT - s.args = "#{box_ip}" end # System-wide vhost-proxy service. # Containers must define a "VIRTUAL_HOST" environment variable to be recognized and routed by the vhost-proxy. - # Image: blinkreaction/nginx-proxy v1.1.0 if $vconfig['vhost_proxy'] - config.vm.provision "shell", run: "always", privileged: false do |s| + config.vm.provision "shell", privileged: false do |s| s.inline = <<-SCRIPT - echo "Starting system-wide HTTP/HTTPS reverse proxy on $1... " - docker rm -f vhost-proxy > /dev/null 2>&1 || true - docker run -d --name vhost-proxy --label "group=system" -p $1:80:80 -p $1:443:443 \ + echo "Setting up system-wide HTTP/HTTPS reverse proxy... " + docker run -d --name vhost-proxy --label "group=system" --restart=always --privileged --userns=host \ + -p 80:80 -p 443:443 \ -v /var/run/docker.sock:/tmp/docker.sock \ - blinkreaction/nginx-proxy@sha256:1707c0fd2fa4f0e98a656f748a4edb8a04578e9dc63115acc23a05225f151e04 > /dev/null 2>&1 + blinkreaction/nginx-proxy:stable > /dev/null 2>&1 SCRIPT - s.args = "#{box_ip}" end end diff --git a/scripts/presetup-mac.sh b/scripts/presetup-mac.sh index b113943..fbecd8d 100755 --- a/scripts/presetup-mac.sh +++ b/scripts/presetup-mac.sh @@ -1,7 +1,7 @@ #!/bin/bash -DOCKER_VERSION=1.10.3 -DOCKER_COMPOSE_VERSION=1.6.2 +DOCKER_VERSION=1.11.2 +DOCKER_COMPOSE_VERSION=1.7.1 # Console colors red='\033[0;31m' @@ -32,11 +32,15 @@ VBoxManage hostonlyif remove vboxnet0 > /dev/null 2>&1 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}..." 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 +# 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 diff --git a/scripts/presetup-ubuntu.sh b/scripts/presetup-ubuntu.sh deleted file mode 100644 index 39f21ef..0000000 --- a/scripts/presetup-ubuntu.sh +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/bash - -DOCKER_VERSION=1.9.1 -DOCKER_COMPOSE_VERSION=1.5.2 - -#-------------------------- Helper functions -------------------------------- - -# 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}"; } - -if_failed () -{ - if [ ! $? -eq 0 ]; then - if [[ "$1" == "" ]]; then msg="dsh: error"; else msg="$1"; fi - echo-red "dsh: $msg" - exit 1 - fi -} - -#-------------------------- Installation -------------------------------- - -if [ -r /etc/lsb-release ]; then - lsb_dist="$(. /etc/lsb-release && echo "$DISTRIB_ID")" - lsb_release="$(. /etc/lsb-release && echo "$DISTRIB_RELEASE")" -fi - -if [[ $lsb_dist != 'Ubuntu' || $lsb_release < '14.04' ]]; then - echo-red "Sorry, this script only supports Ubuntu 14.04+" - exit 1 -fi - -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 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 -if_failed "Docker Compose installation/upgrade failed." - -echo-green "Adding a subnet for DockerBox..." -ip_mask="192.168.10.1/24" -# Make sure we don't do this twice -if ! grep -q $ip_mask /etc/network/interfaces; then - cat > /tmp/dockerbox.ip.addr </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 +# 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 diff --git a/vagrant.yml b/vagrant.yml index 9efdd97..2f268f2 100644 --- a/vagrant.yml +++ b/vagrant.yml @@ -50,7 +50,7 @@ synced_folders: # VirtualBox VM settings v.gui: false # Set to true for debugging. Will unhide VM's primary console screen. -v.memory: 2048 # Memory settings. +v.memory: 1024 # Memory settings. v.cpus: 1 # CPU settings. VirtualBox works much better with a single CPU. # Network settings