多个Docker容器无法正常运行启动程序

时间:2017-04-27 09:46:46

标签: docker

我有一个脚本,它使用相同的已安装数据量生成多个容器(来自单个图像);和相同的启动命令(但此命令具有不同的参数/参数)。此命令接受视频文件并使用指定的参数集处理它。

脚本负责分配哪个视频文件以及要为容器提供的参数。每个容器仅使用一组参数处理1个视频文件。将其结果写入具有不同文件名的数据卷,然后最终退出。

容器按预期生成,但只处理每个videofile上的第一个配置(例如vid1 + config1和vid2 + config1)。具有不同配置的其他容器(例如vid1 + config2,vid1 + config3,vid2 + config2等)未按预期完成 - 输出文件丢失或根本未创建

以下是生成容器的脚本:

#!/bin/bash    
source "$1"
echo "DescriptorFile = ${DescriptorFile}"
echo "nCounter Config File = ${nCounterConfigFile}"
echo "HT_start = ${HT_start}"
echo "HT_end = ${HT_end}"
echo "HT_step = ${HT_step}"
echo "VideoDirectory = ${VideoDirectory}"
echo "VideoFileExtension = ${VideoFileExtension}"

CURR_DIR=$PWD
cd $VideoDirectory
VideoDirectory=${VideoDirectory}
currHT=$HT_start
for f in $VideoDirectory*$VideoFileExtension
do
currHT=$HT_start

    while [ $(echo " $currHT <= $HT_end" | bc -l)  == 1 ]   
    do
           echo "Current active HT = $currHT"
            ##spawn containers
             (docker run -t \
                -v ${VideoDirectory}:/home/validationVideos \
                -v $CURR_DIR/modelFiles:/home/modelFiles \
                -v $CURR_DIR/nCounterConfigFiles:/home/nCounterConfigFiles \
                -v $CURR_DIR/Results:/home/results \
                    validationdocker /home/start.sh \
               -f /home/validationVideos/${f##*/} -c 
               /home/nCounterConfigFiles/$nCounterConfigFile -m 
               /home/modelFiles/$DescriptorFile -h $currHT -l 
               /home/dough_$CURR_CONTAINERS -w 0 -d  $CURR_CONTAINERS && 
               CURR_CONTAINERS=`expr $CURR_CONTAINERS - 1`) & 

            CURR_CONTAINERS="$(echo $CURR_CONTAINERS + 1| bc)"

        currHT="$(echo $currHT + $HT_step | bc)"
    done
 done

 exit

start.sh的用法是 “用法:命令&lt; -f videofile -c configfile -m datModelfile -h htvalue -l saveDoughLocation -w boolIntShowWindow -d dockerID

任何线索都会非常感激!我在ubuntu 16.04上运行docker 1.13.1

最佳, 汤姆

Here are the results of docker logs on the first Docker Container DocekrID_0. See the dough was created and process completed successfully

On second run, dough was not created even though only 1 parameter changed and is absolutely valid

docker事件的结果中没有值得注意的条目。我想把图片放在一边,但由于Stackoverflow的限制我不能这样做

0 个答案:

没有答案