Quantcast
Viewing all articles
Browse latest Browse all 2

shell script inside docker

i try run docker with entrypoint.sh, but it doesn't exequite .sh line:

echo `ls -d /input/sub-*/ | sed -e 's/.*sub-\(.*\)\//\1/' | split -l 8 - participants_`

I wrote it in dockerfile:

ENTRYPOINT ["bash", "-c", "source /code/entrypoint.sh | ts '[%Y-%m-%d %H:%M:%S]' &>> /output/stderr.log"]

Why echo doesn't execute inside docker run [my_image]

Here is full entrypoint.sh code:

#! /bin/bash

alias time='/usr/bin/time -f "%C --- CPU:\t%E real,\t%U user,\t%S 
sys\t%P\tMem:\t%KkiB avg.,\t%MkiB max.\tExit:\t%x"'

echo `ls -d /input/sub-*/ | sed -e 's/.*sub-\(.*\)\//\1/' | split -l 8 - 
participants_`

while read input_bids_path
do      
    participants_id=$(basename $input_bids_path)
    LD_LIBRARY_PATH=/usr/lib/fsl/5.0:$LD_LIBRARY_PATH
    time fmriprep /input /output participant --fs-license-file 
/opt/freesurfer/license.txt --fs-no-reconall --use-aroma --ignore fieldmaps 
--n_cpus 12 --force-bbr --participant_label $(cat $participants_id) -w 
/output
#   rm -r /input/$participants_id
done < <(find /input -name "*participants_*" -type f)
echo  `rm -r /input/$participants_id`
wait `jobs -p` && echo __ok__ || echo __err__

Viewing all articles
Browse latest Browse all 2

Trending Articles