-
Hi team, Here is my Dockerfile: FROM debian:bullseye
RUN apt update && apt install -y --no-install-recommends gnupg
RUN echo "deb http://archive.raspberrypi.org/debian/ bullseye main" > /etc/apt/sources.list.d/raspi.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 82B129927FA3303E
RUN apt update && apt install -y --no-install-recommends \
python3-pip \
python3-picamera2 \
&& apt-get clean \
&& apt-get autoremove \
&& rm -rf /var/cache/apt/archives/* \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY rpi_camera /app/rpi_camera
CMD ["python3", "/app/rpi_camera/main.py"] docker-compose.yaml version: '3.8'
services:
camera:
build:
context: .
dockerfile: Dockerfile
restart: always
privileged: true
devices:
- "/dev:/dev" But it fails with: INFO Camera camera_manager.cpp:297 libcamera v0.0.5+83-bde9b04f
Camera(s) not found (Do not forget to disable legacy camera with raspi-config).
Camera __init__ sequence did not complete.
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 242, in __init__
self._open_camera()
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 442, in _open_camera
if not self._initialize_camera():
File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 406, in _initialize_camera
raise RuntimeError("Camera(s) not found (Do not forget to disable legacy camera with raspi-config).")
RuntimeError: Camera(s) not found (Do not forget to disable legacy camera with raspi-config). at the same time the same |
Beta Was this translation helpful? Give feedback.
Answered by
hyzhak
Feb 13, 2024
Replies: 1 comment 1 reply
-
After some experiments, I found the optimal configuration that allows access to a camera. Here is a repository with a simplified example https://github.com/hyzhak/pi-camera-in-docker |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
hyzhak
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
After some experiments, I found the optimal configuration that allows access to a camera. Here is a repository with a simplified example https://github.com/hyzhak/pi-camera-in-docker