Fix entrypoint exec format error: bash CMD, CRLF strip after COPY
Browse files- scripts/entrypoint.sh +4 -4
scripts/entrypoint.sh
CHANGED
|
@@ -16,6 +16,8 @@ COPY requirements.txt /app/requirements.txt
|
|
| 16 |
COPY app.py space_gen.py space_health.py /app/
|
| 17 |
COPY services /app/services
|
| 18 |
COPY scripts /app/scripts
|
|
|
|
|
|
|
| 19 |
|
| 20 |
ENV PYTHONPATH=/app/vendor/rllm
|
| 21 |
ENV GRADIO_SERVER_PORT=7860
|
|
@@ -34,9 +36,7 @@ RUN pip install --no-cache-dir --upgrade pip setuptools wheel \
|
|
| 34 |
ARG INSTALL_VLLM=1
|
| 35 |
RUN if [ "$INSTALL_VLLM" = "1" ]; then pip install --no-cache-dir "vllm>=0.6.3"; fi
|
| 36 |
|
| 37 |
-
# Strip Windows CRLF if present (avoids: /usr/bin/env: 'bash\r': No such file or directory)
|
| 38 |
-
RUN sed -i 's/\r$//' /app/scripts/entrypoint.sh && chmod +x /app/scripts/entrypoint.sh
|
| 39 |
-
|
| 40 |
EXPOSE 7860
|
| 41 |
|
| 42 |
-
|
|
|
|
|
|
| 16 |
COPY app.py space_gen.py space_health.py /app/
|
| 17 |
COPY services /app/services
|
| 18 |
COPY scripts /app/scripts
|
| 19 |
+
# CRLF here causes "exec format error" when the container execs the script; strip immediately after copy.
|
| 20 |
+
RUN sed -i 's/\r$//' /app/scripts/entrypoint.sh && chmod +x /app/scripts/entrypoint.sh
|
| 21 |
|
| 22 |
ENV PYTHONPATH=/app/vendor/rllm
|
| 23 |
ENV GRADIO_SERVER_PORT=7860
|
|
|
|
| 36 |
ARG INSTALL_VLLM=1
|
| 37 |
RUN if [ "$INSTALL_VLLM" = "1" ]; then pip install --no-cache-dir "vllm>=0.6.3"; fi
|
| 38 |
|
|
|
|
|
|
|
|
|
|
| 39 |
EXPOSE 7860
|
| 40 |
|
| 41 |
+
# Invoke via bash so a bad shebang/CRLF cannot produce "exec format error" from the kernel.
|
| 42 |
+
CMD ["/bin/bash", "/app/scripts/entrypoint.sh"]
|