Azure-Samples / container-apps-store-api-microservice

Sample microservices solution using Azure Container Apps, Dapr, Cosmos DB, and Azure API Management
MIT License
340 stars 422 forks source link

Invalid Command in docker-in-docker-debian.sh due to "core.autocrlf true" on Windows #30

Open DanWahlin opened 2 years ago

DanWahlin commented 2 years ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [X ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

  1. Clone the repo to a Windows machine where git is configured globally to core.autocrlf true.
  2. Open the project in VS Code and allow it to restart in a Remote Container environment.
  3. You'll get an error related to the docker-in-docker-debian.sh file (CRLF error on Line 11, 18, etc.).
  4. Process fails as a result of the above error.

Any log messages given by the failure

Invalid command in docker-in-docker-debian.sh (unrecognized command is the result of \r endings)

Expected/desired behavior

Start up the Remote Container environment.

OS and Version?

Windows 10 21H2 (OS Build 19044.1889) - I'm on a virtual machine provided to me for use in another scenario

Versions

VS Code 1.70.2

Mention any other details that might be useful

It looks like this is an issue with how git is configured on this particular Windows machine. I did the following to fix the issue:

It might be helpful to mention this in the build-and-run.md file for others who may hit the issue on Windows. Another option to help make it automatic would be to add a .gitattributes file with * text=auto eol=lf in it (although I'd have to validate that in this case).