I'm trying to use Docker to run a shell script. Here is my Dockerfile:
FROM alpine
COPY . .
RUN chmod +x ./scripts/sanity-checks.sh
ENTRYPOINT ["./scripts/sanity-checks.sh"]
However, when I try to run it, I get the following error:
./scripts/sanity-checks.sh: scripts/util.sh: line 225: syntax error: unexpected "(" (expecting "}")
This is what I have in util.sh:
...
# delete the lines between and including 2 comment lines, or the comment lines themselves only
delete_lines_for_file() {
file_name=$1
delete_string_start=$2
delete_string_end=$3
delete_comments_only=$4
# find the start and end lines where we want to delete blocks of code
line_num_start=$(grep -n "$delete_string_start" $file_name | awk -F ":" '{print $1}')
line_num_end=$(grep -n "$delete_string_end" $file_name | awk -F ":" '{print $1}')
line_start_arr=($line_num_start) ### LINE 225 ###
...
The script works fine when I run it without using Docker. Any idea what might be causing this error?