Azure-devops-docs: bash: ./start.sh: /bin/bash^M: bad interpreter: No such file or directory

Created on 15 May 2019  Â·  4Comments  Â·  Source: MicrosoftDocs/azure-devops-docs

When I first tried to run the docker container, after building it in a Windows 10 machine, I got the following error: "standard_init_linux.go:207: exec user process caused "no such file or directory"". Some research and an interactive session were enough to find the solution to this issue (https://askubuntu.com/questions/304999/not-able-to-execute-a-sh-file-bin-bashm-bad-interpreter). Therefore recommend to modify the last RUN as follows:

RUN chmod +x start.sh \
&& sed -i -e 's/\r$//' start.sh


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

devops-cictech devopprod support-request

Most helpful comment

If you're using VS Code change the "End of Line Sequence" from CRLF to LF on the "start.sh" file that did the trick for me.

All 4 comments

A better alternative might be to use an advanced editor, like Vim or Notepad++, that can save files with unix line endings; or to simply use dos2unix before copying the file into the container image.

In this specific case the editor used was VS Code. However I do think it would be best to have that additional step in the Docker image so that the example Dockerfile can be built either in Windows or Linux systems without requiring to run additional software.

If you're using VS Code change the "End of Line Sequence" from CRLF to LF on the "start.sh" file that did the trick for me.

@vtbassmatt if you want these assigned to @juliobv, then he needs to be added to this repo

Was this page helpful?
0 / 5 - 0 ratings