move normalization
authorSam <sam.saffron@gmail.com>
Thu, 14 Apr 2016 06:21:47 +0000 (16:21 +1000)
committerSam <sam.saffron@gmail.com>
Thu, 14 Apr 2016 06:21:47 +0000 (16:21 +1000)
launcher

index 1852382bb01263f21cd6f0f6eeae5c676b3d6413..ed91e797fbcb28c6cc9a3402339f8616ca372a09 100755 (executable)
--- a/launcher
+++ b/launcher
@@ -515,10 +515,6 @@ run_start(){
 
    (
      hostname=`hostname -s`
-     # we got to normalize so we only have allowed strings, this is more comprehensive but lets see how bash does first
-     # hostname=`$docker_path run $user_args --rm $image ruby -e 'print ARGV[0].gsub(/[^a-zA-Z-]/, "-")' $hostname`
-     # docker added more hostname rules
-     hostname=${hostname/_/-}
      # overwrite hostname
      if [ "$DOCKER_USE_HOSTNAME" = "true" ]
      then
@@ -527,6 +523,11 @@ run_start(){
        hostname=$hostname-$config
      fi
 
+     # we got to normalize so we only have allowed strings, this is more comprehensive but lets see how bash does first
+     # hostname=`$docker_path run $user_args --rm $image ruby -e 'print ARGV[0].gsub(/[^a-zA-Z-]/, "-")' $hostname`
+     # docker added more hostname rules
+     hostname=${hostname/_/-}
+
      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