From f31e582f80d1b91cca4702ebe0cf9d5bf95b2f41 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Sun, 30 Oct 2016 23:46:01 -0400 Subject: [PATCH] dockcross: Simplify container name generation using $RANDOM This commit removes the complex pipeline leveraging output from /dev/urandom and simply uses $RANDOM variable. For the purpose of generating an available container name, it will works well. Suggested-by: Matt McCormick --- imagefiles/dockcross | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imagefiles/dockcross b/imagefiles/dockcross index 6f3f319..c279863 100755 --- a/imagefiles/dockcross +++ b/imagefiles/dockcross @@ -180,7 +180,7 @@ fi # Now, finally, run the command in a container # tty -s && TTY_ARGS=-ti || TTY_ARGS= -CONTAINER_NAME=dockcross_$(head -c 500 /dev/urandom | base64 | tr -dc 'a-zA-Z0-9' | fold -w 7 | head -n 1) +CONTAINER_NAME=dockcross_$RANDOM docker run $TTY_ARGS --name $CONTAINER_NAME \ -v $PWD:/work \ $USER_IDS \