django / djangoproject.com

Source code to djangoproject.com
https://www.djangoproject.com/
BSD 3-Clause "New" or "Revised" License
1.86k stars 937 forks source link

Docker Setup: docker-entrypoint.sh File Overwritten with Windows Line Endings #1467

Closed Ssyba closed 6 days ago

Ssyba commented 5 months ago

Summary: I encountered an issue while setting up the Django project using Docker on a Windows environment. Following the steps in the documentation under "Running Locally with Docker", I found that the docker-entrypoint.sh file gets overwritten with Windows line endings (CRLF), despite being cloned with the correct Linux file endings (LF). This causes script execution errors when running docker-compose up.

Steps to Reproduce:

  1. Clone the Django project repository on a Windows machine.
  2. Follow the instructions in the documentation under "Running Locally with Docker".
  3. Run docker-compose build.
  4. Execute docker-compose up.
  5. Observe the error related to docker-entrypoint.sh script execution.

Expected vs. Actual Results:

Environment:

Proposed Solution: I suggest updating the documentation with a note about this issue for Windows users. This note could include instructions on how to ensure correct line endings for docker-entrypoint.sh, such as using Git configurations to avoid automatic conversion or manually converting the file back to LF endings before running Docker.

Offer to Contribute: I am willing to contribute by updating the documentation with the proposed solution to assist other Windows users encountering this issue.