Commit graph

2 commits

Author SHA1 Message Date
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
Eberhard Beilharz
739bdf788f maint: always use LF for Dockerfiles
When running Docker on Windows Docker is not able to properly adjust to
the line ending. When it builds the image from a Dockerfile that's
checked out with the Windows-style line endings (\r\n), and it runs a
command like

```Dockerfile
RUN <<EOF cat > /usr/bin/bashwrapper
echo "Hello world!"
EOF
```

it makes the filename `/usr/bin/bashwrapper\r`! This change works around
this problem by always using LF line endings for
`resources/docker-images/**/Dockerfile`.
2025-06-06 17:14:16 +02:00