mirror of
				https://github.com/bensuperpc/dockcross.git
				synced 2025-10-26 05:56:21 +01:00 
			
		
		
		
	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 <matt.mccormick@kitware.com>
This commit is contained in:
		| @@ -180,7 +180,7 @@ fi | |||||||
| # Now, finally, run the command in a container | # Now, finally, run the command in a container | ||||||
| # | # | ||||||
| tty -s && TTY_ARGS=-ti || TTY_ARGS= | 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 \ | docker run $TTY_ARGS --name $CONTAINER_NAME \ | ||||||
|     -v $PWD:/work \ |     -v $PWD:/work \ | ||||||
|     $USER_IDS \ |     $USER_IDS \ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Jean-Christophe Fillion-Robin
					Jean-Christophe Fillion-Robin