From 2a3fd15003e665ef65a68586add252cfeef3e805 Mon Sep 17 00:00:00 2001 From: Ron Webb Date: Sat, 17 May 2025 20:33:41 +1200 Subject: [PATCH] Add conditional installation of dos2unix to handle CRLF line endings --- run/docker/Dockerfile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/run/docker/Dockerfile b/run/docker/Dockerfile index 59bd8e5..fac40d7 100644 --- a/run/docker/Dockerfile +++ b/run/docker/Dockerfile @@ -17,6 +17,16 @@ RUN python manage.py collectstatic --noinput EXPOSE 8000 +# Install dos2unix only if needed and convert line endings if necessary +RUN if file /srv/run/docker/start.sh | grep -q "CRLF"; then \ + apt-get update && apt-get install -y dos2unix && \ + dos2unix /srv/run/docker/start.sh && \ + apt-get remove -y dos2unix && \ + apt-get autoremove -y && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/*; \ + fi + RUN chmod +x /srv/run/docker/start.sh CMD ["/srv/run/docker/start.sh"] \ No newline at end of file