Hi
We’ve been seeing oddities with some docker run commands which fail unless they are the 2nd command in a multiple command string submitted using bash -c.
With a random ‘export’ prior to a perl command:
docker run -m 4g -l eaglegenomics/test bash -c 'export BLAH=1; perl -e "use IPC::Cmd; my \$ret = IPC::Cmd::run_forked(q(aws s3 ls s3://eagle/test_data/rna-seq/sample_reads_1.fastq.gz), {timeout => 30}); use Data::Dumper; print q(ret is ).Dumper(\$ret).\"\n\"";'
ret is $VAR1 = {
'stderr' => '',
'child_pgid' => 8,
'killed_by_signal' => 0,
'parent_died' => 0,
'exit_code' => 0,
'err_msg' => 'stdout:
2015-10-29 11:22:12 44587 sample_reads_1.fastq.gz
Without the preceding ‘export’ command, perl command fails:
docker run -m 4g -l eaglegenomics/test bash -c 'perl -e "use IPC::Cmd; my \$ret = IPC::Cmd::run_forked(q(aws s3 ls s3://eagle/test_data/rna-seq/sample_reads_1.fastq.gz), {timeout => 30}); use Data::Dumper; print q(ret is ).Dumper(\$ret).\"\n\"";'
ret is $VAR1 = {
'stderr' => '',
'child_pgid' => 7,
'killed_by_signal' => 0,
'parent_died' => 0,
'exit_code' => 0,
'err_msg' => '',
'timeout' => 0,
'merged' => '',
'stdout' => ''
};
Note absence of file listing.
We have also seen this with other non-perl commands. Unfortunately we can’t use this workaround, as the problem is conflated due to using docker swarm manager to submit the jobs, which in our current environment, seems to have problems handling the quotes in the bash command (related post coming soon).
Can anyone enlighten me as to why this is happening? And possible solutions which don’t include a multiple command string?
Thanks in advance
Nathan Johnson