Trying to run this Docker Compose file and running into an issue during the Dockerfile build stage where if I build a test of the Dockerfile outside of the compose file it seems to work, but when I try it live, it always fails with the error:
Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: "./entrypoint.sh": stat ./entrypoint.sh: no such file or directory: unknown
Docker File:
FROM debian:bullseye
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y cmake build-essential curl git
RUN echo "deb http://archive.raspberrypi.org/debian/ bullseye main" > /etc/apt/sources.list.d/raspi.list
RUN curl "https://archive.raspberrypi.org/debian/raspberrypi.gpg.key" | apt-key add -
RUN apt-get update && apt-get install -y libcamera-dev libjpeg-dev libgphoto2-dev
RUN git clone https://github.com/ArduCAM/mjpg-streamer.git /src
WORKDIR /src/mjpg-streamer-experimental
RUN sed -i "/input_libcamera/p;/input_/d;/output_http/p;/output_/d" CMakeLists.txt
RUN make && make install
COPY entrypoint.sh /entrypoint.sh
ENV INPUT_FLAGS "-r 1640x1232 -f 10"
ENV OUTPUT_FLAGS "-w ./www"
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]
**Docker Compose File: **
version: "3"
services:
mjpg-streamer:
build:
context: ./mjpg-streamer
dockerfile: Dockerfile
restart: always
privileged: true
ports:
- 8080:8080
environment:
- INPUT_FLAGS=-r 1640x1232 -f 10
- OUTPUT_FLAGS=-w ./www
volumes:
- /run/udev:/run/udev:ro
- /opt/Octoprint/mjpg-streamer:/mjpg-streamer
octoprint:
image: octoprint/octoprint:latest
restart: always
privileged: true
ports:
- 9003:80
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
volumes:
- /opt/Octoprint/data/octoprint:/octoprint
- /proc/cpuinfo:/proc/cpuinfo:ro
- /usr/bin/vcgencmd:/usr/bin/vcgencmd:ro
- /usr/lib/aarch64-linux-gnu/libvcos.so.0:/usr/lib/aarch64-linux-gnu/libvcos.so.0:ro
- /usr/lib/aarch64-linux-gnu/libvchiq_arm.so.0:/usr/lib/aarch64-linux-gnu/libvchiq_arm.so.0:ro
These docker files are based on this repo: octoprint-libcamera
I have made several alterations to fit my own environment, and the Octoprint side of the docker-compose works without issue. It all seems to be tied to the Entrypoint.sh file
I've wracked my brain around this for a week now. As far as I can guess, the entrypoint file isn't being properly sent to the container but uncertain why. A second (or several) pair of eyes would be appreciated.
I made several alterations to the entrypoint location in futile attempts to resolve the issue.
Attempt 1:
COPY entrypoint.sh /entrypoint.sh
ENV INPUT_FLAGS "-r 1640x1232 -f 10"
ENV OUTPUT_FLAGS "-w ./www"
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./mjpg-streamer/entrypoint.sh"]
Attempt 2:
COPY /entrypoint.sh /entrypoint.sh
ENV INPUT_FLAGS "-r 1640x1232 -f 10"
ENV OUTPUT_FLAGS "-w ./www"
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]
Attempt 3:
COPY /entrypoint.sh /entrypoint.sh
ENV INPUT_FLAGS "-r 1640x1232 -f 10"
ENV OUTPUT_FLAGS "-w ./www"
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./mjpg-streamer/entrypoint.sh"]
Attempt 4:
COPY entrypoint.sh entrypoint.sh
ENV INPUT_FLAGS "-r 1640x1232 -f 10"
ENV OUTPUT_FLAGS "-w ./www"
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]
Attempt 5:
COPY ./mjpg-streamer/entrypoint.sh /entrypoint.sh
ENV INPUT_FLAGS "-r 1640x1232 -f 10"
ENV OUTPUT_FLAGS "-w ./www"
RUN chmod +x entrypoint.sh
ENTRYPOINT ["./entrypoint.sh"]