How about `mktemp -d ${TMPDIR:-/tmp}/dockerdl.XXXXXXX` ?