@@ -742,7 +742,7 @@ int DOCKER_CONN::init(DOCKER_TYPE docker_type, bool _verbose) {
742742}
743743#endif
744744
745- // issue a Docker command and return its output
745+ // issue a Docker command and return its output (stdout + stderr)
746746// as a vector of lines (\n-terminated)
747747//
748748int DOCKER_CONN::command (const char * cmd, vector<string> &out) {
@@ -758,7 +758,7 @@ int DOCKER_CONN::command(const char* cmd, vector<string> &out) {
758758 // In the Win case we read the output from a pipe.
759759 // Append 'EOM' to the output so we know when we've reached the end
760760
761- snprintf (buf, sizeof (buf), " %s %s; echo EOM\n " , cli_prog, cmd);
761+ snprintf (buf, sizeof (buf), " %s %s 2>&1 ; echo EOM\n " , cli_prog, cmd);
762762 write_to_pipe (ctl_wc.in_write , buf);
763763 retval = read_from_pipe (
764764 ctl_wc.out_read , ctl_wc.proc_handle , output, CMD_TIMEOUT, " EOM"
@@ -770,7 +770,7 @@ int DOCKER_CONN::command(const char* cmd, vector<string> &out) {
770770 out = split (output, ' \n ' );
771771#else
772772 snprintf (buf, sizeof (buf),
773- " %s %s" ,
773+ " %s %s 2>&1 " ,
774774 cli_prog, cmd
775775 );
776776 retval = run_command (buf, out);
0 commit comments