Skip to content

Commit c1a1b02

Browse files
committed
fix(docker): inline entrypoint.sh to permanently fix exec format error
1 parent ed17026 commit c1a1b02

File tree

2 files changed

+17
-19
lines changed

2 files changed

+17
-19
lines changed

Dockerfile

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,23 @@ COPY --chown=appuser:appuser qwed_sdk /app/qwed_sdk/
3636
COPY --chown=appuser:appuser action_entrypoint.py /action_entrypoint.py
3737
RUN chmod +x /action_entrypoint.py
3838

39-
# Copy and setup runtime entrypoint
40-
COPY --chown=appuser:appuser entrypoint.sh /entrypoint.sh
41-
# Checksum and fix line endings
42-
RUN dos2unix /entrypoint.sh && chmod +x /entrypoint.sh
39+
# Create entrypoint.sh directly to avoid Windows line ending issues (CRLF)
40+
RUN printf '#!/bin/bash\n\
41+
set -e\n\
42+
\n\
43+
# Fix permissions for workspace\n\
44+
if [ -d "/github/workspace" ]; then\n\
45+
chown -R appuser:appuser /github/workspace\n\
46+
fi\n\
47+
\n\
48+
# Fix permissions for file commands\n\
49+
if [ -d "/github/file_commands" ]; then\n\
50+
chmod -R 777 /github/file_commands\n\
51+
fi\n\
52+
\n\
53+
# Switch to appuser and run the main entrypoint\n\
54+
exec gosu appuser python /action_entrypoint.py "$@"\n\
55+
' > /entrypoint.sh && chmod +x /entrypoint.sh
4356

4457
# Set Python path to use local SDK
4558
ENV PYTHONPATH=/app

entrypoint.sh

Lines changed: 0 additions & 15 deletions
This file was deleted.

0 commit comments

Comments
 (0)