spiegel-keyman/.gitattributes
Eberhard Beilharz 45f60b56de
maint(common): use LF line endings for scripts
On Windows files are usually checked out with CRLF line endings.
However, the Docker image is Linux and thus expects LF line endings.
This causes conflicts with the scripts and so trying to build in docker
trips over the shebang line that contains CR - see #14153.
https://stackoverflow.com/a/14610574 suggests a workaround, however that
doesn't work because it converts the script on the fly and removes CR and
then reads the script from the command line. This causes the loss of the
script name and thus causes different failures. Even with that solved
it would likely still not work because of the sourced  include scripts
would still contain CRLF line endings.

The only solution seems to be to check out the script files with LF
line endings which also seems to work when building directly on Windows.
See https://blog.programster.org/fixing-docker-volume-windows-line-endings-on-bash-scripts.

Fixes: #14153
Test-bot: skip
2025-08-18 17:50:28 +02:00

10 lines
270 B
Text

# Always use LF for Dockerfile - otherwise HEREDOCs in Dockerfile
# will not work on Windows - we end up with a filename `foo\r` for
# the command
# ```Dockerfile
# RUN <<EOF cat > foo
# echo "Hello world"
# EOF
# ```
Dockerfile text eol=lf
*.sh text eol=lf