Skip to content

Commit ed17026

Browse files
committed
fix(docker): enforce LF line endings via gitattributes and dos2unix
1 parent b217f2b commit ed17026

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Enforce Unix line endings for shell scripts
2+
*.sh text eol=lf

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ RUN useradd -m -u 1000 appuser
1919
# Fix permissions for GitHub Actions workspace
2020
RUN mkdir -p /github/workspace && chown -R appuser:appuser /github
2121

22-
# Install gosu for easy step-down from root
23-
RUN apt-get update && apt-get install -y --no-install-recommends gosu && rm -rf /var/lib/apt/lists/*
22+
# Install gosu and dos2unix for entrypoint management
23+
RUN apt-get update && apt-get install -y --no-install-recommends gosu dos2unix && rm -rf /var/lib/apt/lists/*
2424

2525
# Copy requirements file first to leverage cache
2626
COPY requirements.txt /app/requirements.txt
@@ -38,8 +38,8 @@ RUN chmod +x /action_entrypoint.py
3838

3939
# Copy and setup runtime entrypoint
4040
COPY --chown=appuser:appuser entrypoint.sh /entrypoint.sh
41-
# Fix Windows line endings (CRLF) which cause "exec format error"
42-
RUN sed -i 's/\r$//' /entrypoint.sh && chmod +x /entrypoint.sh
41+
# Checksum and fix line endings
42+
RUN dos2unix /entrypoint.sh && chmod +x /entrypoint.sh
4343

4444
# Set Python path to use local SDK
4545
ENV PYTHONPATH=/app

0 commit comments

Comments
 (0)