3

I'm trying to run a simple command inside a file.sh script, but is not working.

My Dockerfile is like this

FROM microsoft/mssql-server-linux:2017-latest
ENV SA_PASSWORD=Passw0rd
ENV ACCEPT_EULA=Y
COPY entrypoint.sh entrypoint.sh
COPY SqlCmdStartup.sh SqlCmdStartup.sh
COPY SqlCmdScript.sql SqlCmdScript.sql
RUN chmod +x ./SqlCmdStartup.sh
CMD /bin/bash ./entrypoint.sh

The first line of SqlCmdStartup.sh is

sleep 20s

But I'm receiving this error:

sleep: invalid time interval '20s\r'
Try 'sleep --help' for more information.

I'm following this example: https://msdn.microsoft.com/en-us/magazine/mt784660.aspx

1 Answers1

2

The \r in the error message suggests that your line endings are badly encoded.

Ensure that end of line chars of SqlCmdStartup.sh are LF for Unix not CR LF (Windows) as it seem to be.

More details here : Difference between CR LF, LF and CR line break types?

Sébastien Helbert
  • 2,185
  • 13
  • 22