Sourav Karmakar
Sourav Karmakar

Reputation: 95

sh script not running inside a alpine:3.12 container when created from the image, but it is running when manually triggered inside the pod

Here is the Dockerfile I have used:

FROM alpine:3.12
RUN apk add --no-cache util-linux python3 py3-pip
RUN apk add --no-cache --upgrade bash

COPY 1#check_dmesg_logs.sh /usr/local/bin/check-dmesg-logs.sh
RUN chmod +x /usr/local/bin/check-dmesg-logs.sh

CMD ["sh", "/usr/local/bin/check-dmesg-logs.sh"]

Below is the script I'm trying to run:

#!/bin/sh
while true; do
    dmesg | grep -i 'nfs' 
    dmesg | grep -i 'rpc'
    sleep 10
done

Error: /usr/local/bin/check-dmesg-logs.sh: line 7: syntax error: unexpected "done" (expecting "do")

Upvotes: 0

Views: 66

Answers (0)

Related Questions