Launcher script fails due to "Argument list too long"

Hey guys,

We are currently using discourse as a multi-tenanted community platform. Every time we add a new tenant our containers/"$config".yml files grow. The issue is that we’ve already reached the point where commands such as

raw=`exec echo "$input" | $docker_path run $user_args --rm -i -a stdin -a stdout $image ruby -e "$env_ruby"

have started to fail due to “Argument list too long” presumably because the size of “$input” (which is built using the config file) is too big for echo to handle.

Do you guys have any suggestion for this?