From 96e9087f411f1cb4527f3b7ef89998296d6f544d Mon Sep 17 00:00:00 2001 From: Subhranil Sarkar Date: Mon, 13 Apr 2026 21:49:08 +0530 Subject: [PATCH] fix: resolve CRLF line ending issue for Windows users Windows Git converts LF to CRLF by default, causing entrypoint.sh to fail inside Alpine Linux containers with 'no such file or directory'. Changes: - Dockerfile: added sed to strip carriage returns from entrypoint.sh - .gitattributes: enforce LF line endings for all shell scripts Fixes #289 --- .gitattributes | 4 ++++ Dockerfile | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..79912042 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,4 @@ +# Enforce Unix line endings for shell scripts +*.sh text eol=lf +entrypoint.sh text eol=lf +identifier.sh text eol=lf \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d8d35140..495c9b38 100644 --- a/Dockerfile +++ b/Dockerfile @@ -52,7 +52,9 @@ RUN apk --no-cache upgrade && \ # Copy the compiled binary and entrypoint (--chmod avoids extra RUN chmod layers) COPY --from=builder --chmod=755 /app/target/release/oxicloud /usr/local/bin/ -COPY --chmod=755 entrypoint.sh /usr/local/bin/entrypoint.sh +COPY entrypoint.sh /usr/local/bin/entrypoint.sh +RUN sed -i 's/\r//' /usr/local/bin/entrypoint.sh && \ + chmod 755 /usr/local/bin/entrypoint.sh # Copy processed static files (bundled/minified by build.rs in release) COPY --from=builder --chown=oxicloud:oxicloud /app/static-dist /app/static