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

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

Open
#30 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Shell
Stars
356
Forks
420
PR merge metrics
No merged PRs in 30d

Description

> 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:

- Ran `git config --global core.autocrlf false`
- Recloned the project and allowed VS Code to run the Remote Container environment.

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).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.