puts env.map{|k,v| "-e\n#{k}=#{v}" }.join("\n")
RUBY
- raw=`exec echo "$input" | $docker_path run $user_args --rm -i -a stdin -a stdout $image ruby -e "$env_ruby"`
+ tmp_input_file=$(mktemp)
+
+ echo "$input" > "$tmp_input_file"
+ raw=`exec cat "$tmp_input_file" | $docker_path run $user_args --rm -i -a stdin -a stdout $image ruby -e "$env_ruby"`
+
+ rm -f "$tmp_input_file"
env=()
ok=1
puts labels.map{|k,v| "-l\n#{k}=#{v}" }.join("\n")
RUBY
- raw=`exec echo "$input" | $docker_path run $user_args --rm -i -a stdin -a stdout $image ruby -e "$labels_ruby"`
+ tmp_input_file=$(mktemp)
+
+ echo "$input" > "$tmp_input_file"
+ raw=`exec cat "$tmp_input_file" | $docker_path run $user_args --rm -i -a stdin -a stdout $image ruby -e "$labels_ruby"`
+
+ rm -f "$tmp_input_file"
labels=()
ok=1
echo $run_command
unset ERR
- (exec echo "$input" | $docker_path run --shm-size=512m $user_args $links "${env[@]}" -e DOCKER_HOST_IP="$docker_ip" --cidfile $cidbootstrap -i -a stdin -a stdout -a stderr $volumes $image \
+
+ tmp_input_file=$(mktemp)
+
+ echo "$input" > "$tmp_input_file"
+ (exec cat "$tmp_input_file" | $docker_path run --shm-size=512m $user_args $links "${env[@]}" -e DOCKER_HOST_IP="$docker_ip" --cidfile $cidbootstrap -i -a stdin -a stdout -a stderr $volumes $image \
/bin/bash -c "$run_command") || ERR=$?
+ rm -f "$tmp_input_file"
+
unset FAILED
# magic exit code that indicates a retry
if [[ "$ERR" == 77 ]]; then