-
Notifications
You must be signed in to change notification settings - Fork 108
Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Checked the FAQs on the message board for common solutions: (TBD)
- Checked that your issue isn't already filed.
Description
The docker/entrypoint.sh script gets run in an Alpine Linux container, where it is expected to have Linux line endings (just a line-feed). It will produce an error about incorrect syntax when /bin/sh tries to run it if the line endings are Windows line-endings.
Unfortunately, Git can be (and commonly is) configured to "correct" line endings in checked out files to those used by the local system (in my case, Windows). When I checked out this repo, the entrypoint.sh script had its line endings changed to Windows' CRLF (carriage-return and line-feed), giving me syntax errors when Alpine tries to run the script (which gets copied into the container as defined by the dev Dockerfile).
Steps to Reproduce
The quickest response will be spurred by providing a Postman json file with the exact request or progression of requests that cause the issue.
If a Postman file cannot be provided:
- Be on Windows
- Have a Git install configured to change line endings to CRLF
- Clone the `cve-services` repository
- Follow the
docker/README.mdinstructions for instantiating a local dev instance ofcve-services - Observe a
/bin/shsyntax error (my apologies, I didn't capture the exact error message before fixing it myself locally).
Expected behavior:
Be able to run entrypoint.sh in Alpine without syntax errors.
Actual behavior:
/bin/sh in Alpine reports syntax errors for entrypoint.sh, causing container startup to fail.
Reproduces how often:
100% of the time on Windows when the repository was checked out with a Git config that replaces line endings with Windows line endings.
Versions
I've only tried to current instance of the repo.
Additional Information
You can use Git attributes to fix this, by specifying with them that the entrypoint.sh file should never have its line endings changed during Git checkout. See the Git docs for more info: https://git-scm.com/docs/gitattributes#_eol