From a06060011e377dd0c215b955b4bb54e553f30d7a Mon Sep 17 00:00:00 2001 From: Sam Date: Thu, 14 Apr 2016 16:21:47 +1000 Subject: [PATCH] move normalization --- launcher | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/launcher b/launcher index 1852382..ed91e79 100755 --- 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 -- 2.25.1