Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add line-ending rules to .gitattributes #280

Open
matti-lamppu opened this issue Apr 27, 2023 · 0 comments
Open

Add line-ending rules to .gitattributes #280

matti-lamppu opened this issue Apr 27, 2023 · 0 comments

Comments

@matti-lamppu
Copy link

Problem

Certain files are expected to be in LF line-endings during the Docker build process, but depending on a users' git config core.autocrlf setting, these files might not be converted correctly for Windows users.

Motivation

Tunnistamo Docker container cannot be run successfully on Windows-based platforms.

Solution

Two files that should be changed are ./docker-entrypoint.sh and ./manage.py.

If ./docker-entrypoint.sh is some other line-ending than LF, the following error will be given when the docker container tries to start:

exec ./docker-entrypoint.sh: no such file or directory

If ./manage.py is some other line-ending than LF, the following error will be given:

Applying database migrations...
/usr/bin/env: ‘python\r’: No such file or directory

The following additions to ./.gitattributes should be made to fix the issues:

manage.py text eol=lf
*.sh text eol=lf

Additionally, the command git add --renormalize . should be run to convert the line endings according to these rules.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant