Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Add line-ending rules to .gitattributes #280

@matti-lamppu

Description

@matti-lamppu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions