From a102b0460734e93c8c45db11f04ec741ebed2f18 Mon Sep 17 00:00:00 2001 From: sv99 Date: Thu, 18 Sep 2014 17:38:00 +0400 Subject: [PATCH] add brew installation and real check docker client version --- README.md | 23 +++++++++++++++++++++++ docker-osx | 6 +++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ad6066a..a140995 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,29 @@ or curl: curl https://raw.githubusercontent.com/noplay/docker-osx/HEAD/docker-osx > /usr/local/bin/docker-osx chmod +x /usr/local/bin/docker-osx +or brew: + brew create curl https://raw.githubusercontent.com/noplay/docker-osx/HEAD/docker-osx --set-name docker-osx + +```ruby +require "formula" + +class DockerOsx < Formula + homepage "https://github.com/noplay/docker-osx.git" + url "https://raw.githubusercontent.com/noplay/docker-osx/HEAD/docker-osx" + + depends_on "docker" + + def install + bin.install "docker-osx" + end + + test do + system "docker-osx" + end +end +``` + + brew install docker-osx 3. Run: docker-osx shell diff --git a/docker-osx b/docker-osx index bebb9ff..0c8fabf 100755 --- a/docker-osx +++ b/docker-osx @@ -108,9 +108,9 @@ function start_vm() { # Determine currently installed version of Docker INSTALLED_DOCKER_VERSION="" -if [ -f "$VAGRANT_CWD/.docker-version" ] +if [ -f "$DOCKER_BIN" ] then - INSTALLED_DOCKER_VERSION=`cat "$VAGRANT_CWD/.docker-version"` + INSTALLED_DOCKER_VERSION=`$DOCKER_BIN -v | grep -oE "[0-9]+\.[0-9]+\.[0-9]"` fi # Check that dependencies are installed @@ -176,7 +176,7 @@ fi # Set current installed Docker version -echo $DOCKER_VERSION > $VAGRANT_CWD/.docker-version +#echo $DOCKER_VERSION > $VAGRANT_CWD/.docker-version case "$1" in up|start)