Hello,
I’m trying do do over the air updates from my github with a dockerfile. this project is a school project. What i want to do i run the container always on my pynq-z2. In the container is a python script which turn the leds on and of. And here is the problem. i can’t get acces within the docker container to my LED’s. When i do a print(“hello world”) the container is loaded on the pynq and prints the message. When i change the container there is automaticly a new container. Can some one help me ? it needs the pynq library but this not a solution when i add this to requirements.txt
Pynqimage = 3.0.1
python3
dockerfile:
# syntax=docker/dockerfile:1
ARG PLATFORM=linux/arm/v7
# Build fase
FROM --platform=$PLATFORM docker.io/arm32v7/debian:stable AS build
SHELL ["/bin/bash", "-c"]
RUN apt-get update
RUN apt-get install -y \
python3 \
python3-pip \
python3-venv
RUN --network=none groupadd -r builders && useradd --no-log-init -r -g builders builder
USER builder:builders
WORKDIR /build
ADD ./requirements.txt .
ADD ./led.py .
# Zorg dat het script uitvoerbaar is in de buildfase
#RUN chmod +x /build/led.py
# Maak een virtuele omgeving en installeer Python dependencies
RUN --network=none python3 -m venv venv && \
source venv/bin/activate && \
pip install --no-cache-dir -r requirements.txt
# App fase
FROM --platform=$PLATFORM docker.io/arm32v7/debian:stable AS app
# Installeer python3 in de app-fase
RUN apt-get update && apt-get install -y python3 python3-pip
WORKDIR /app
RUN --network=none groupadd -r runners && useradd --no-log-init -r -g runners app
USER app:runners
# Kopieer de virtuele omgeving en het script naar de app fase
COPY --from=build /build/venv /app/venv
COPY --from=build /build/led.py /app/led.py
# Zorg ervoor dat het script uitvoerbaar is
#COPY ./led.py /app/led.py
#RUN chmod +x /app/led.py
# Stel de Python virtuele omgeving in en voer het script uit
ENV PATH="/app/venv/bin:$PATH"
ENTRYPOINT ["python3", "/app/led.py"] ```