When you cannot start Docker container correctly and have problems like No such file or directory or some other unintuitive message, there is one thing you should check first…
Correct line endings (EOL) in files copied to Docker
Check if you pass to Docker image scripts (or other text files) with Unix line endings (LF)!
With wrong EOL you will be lucky if message somehow indicates it, for example:
line 3: $’\r’: command not found
but it often looks in a way which gives no clue, what is wrong.
I once spent more than 2 hours because of it, so I hope that with this blog post you will not have to :)
If you have problem which looks similar but is not caused by wrong EOL, please share it in comment, I will try to help you figure it out,
then update this post for others.