I’m working on getting an Azure DevOps build agent running in a docker container. An error I got while trying to get this done was the following:
exec ./start.sh: no such file or directory
Here is the corresponding (simplified) docker file:
Nothing special...
Where is the fault?
The problem turns out to be the start.sh file itself. I originally created it using Notepad what resulted in Windows-style line endings(CRLF). Instead this should be Linux-style line endings(LF).
There are multiple tools out there that supports this (like Notepad++) but you can also do this through VSCode. At the bottom of the editor you can find the currently used line endings style.
If you click on it you can change it: