Syntax error while running shell script via Dockerfile

Published

While executing the run command, I’m getting syntax error as follows:

 > [10/10] RUN ./download_files.sh:
#15 0.285 ./download_files.sh: 5: ./download_files.sh: Syntax error: "(" unexpected
------
executor failed running [/bin/sh -c ./download_files.sh]: exit code: 2

The Shell script contents are as follows:

#!/bin/sh

mkdir pretrained_models
cd pretrained_models
declare -a StringArray=("https://zenodo.org/record/4751737/files/BC-DeepLIIF_Training_Set.zip" "https://zenodo.org/record/4751737/files/BC-DeepLIIF_Validation_Set.zip" "https://zenodo.org/record/4751737/files/DeepLIIF_BC_Model.zip" "https://zenodo.org/record/4751737/files/DeepLIIF_Latest_Model.zip" "https://zenodo.org/record/4751737/files/DeepLIIF_Testing_Set.zip" "https://zenodo.org/record/4751737/files/DeepLIIF_Training_Set.zip" "https://zenodo.org/record/4751737/files/DeepLIIF_Validation_Set.zip" "https://zenodo.org/record/4751737/files/Evaluation_Excel_Files.zip")
for val in ${StringArray[@]}; do
   exec wget $val
done

Source: Docker Questions

Published
Categorised as docker, dockerfile, shell Tagged , ,

Answers

Leave a Reply

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq