Docker image with a base Image Raspbian Bullseye and has installed python and PiCamera2. Along with these, there is a docker-compose.yaml which contains extra configuration (e.g. volumes, previleged, and devices) in order to be able to run on a Raspberry Pi.
This image is available through Dockerhub, but you can always build it locally:
docker build -t raspbian-picamera2 .
Inside the image there is also a main.py which captures a picture. So all you need to do is to run the following commands:
To start the container with docker compose:
docker-compose up -d
To get into the container with bash:
docker exec -it <container-id> bash
To execute the python code and capture an image:
python3 main.py