latest rubygems has problems
[discourse_docker.git] / launcher
index 6eb11687af4018038b58fef634bc797b56f653bd..27b6a8d6e1e6ece0863a74f4a89b75375b4ee180 100755 (executable)
--- a/launcher
+++ b/launcher
@@ -29,7 +29,7 @@ while [ ${#} -gt 0 ]; do
     DEBUG="1"
     ;;
   --skip-prereqs)
-    SKIP_PREREQ="1"
+    SKIP_PREREQS="1"
     ;;
   --docker-args)
     user_args="$2"
@@ -52,15 +52,15 @@ fi
 
 cd "$(dirname "$0")"
 
-docker_min_version='1.6.0'
-docker_rec_version='1.6.0'
+docker_min_version='1.8.0'
+docker_rec_version='1.8.0'
 git_min_version='1.8.0'
 git_rec_version='1.8.0'
 
 config_file=containers/"$config".yml
 cidbootstrap=cids/"$config"_bootstrap.cid
 local_discourse=local_discourse
-image=discourse/discourse:1.0.17
+image=discourse/discourse:1.3.2
 docker_path=`which docker.io || which docker`
 git_path=`which git`
 
@@ -448,9 +448,12 @@ run_start() {
      # docker added more hostname rules
      hostname=${hostname//_/-}
 
+     mac_address="--mac-address $($docker_path run $user_args -i --rm -a stdout -a stderr $image /bin/sh -c "echo $hostname | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\)\(..\).*$/02:\1:\2:\3:\4:\5/'")"
+
      set -x
      $docker_path run $user_args $links $attach_on_run $restart_policy "${env[@]}" -h "$hostname" \
-        -e DOCKER_HOST_IP=$docker_ip --name $config -t $ports $volumes $docker_args $run_image $boot_command
+        -e DOCKER_HOST_IP=$docker_ip --name $config -t $ports $volumes $mac_address $docker_args \
+        $run_image $boot_command
 
    )
    exit 0