Python Alpine for Raspberry Pi Zero Only [arm32/v6]
91
The image is based on arm32v6/python:alpine with minimal packages installed, including poetry.
#venv.Dockerfile
FROM carrycat/rpi-zero-python:3.11-alpine AS builder
COPY poetry.lock pyproject.toml ./
ARG DEBUG=false
#RUN poetry source add --priority=primary pi https://www.piwheels.org/simple
#RUN poetry source add --priority=primary PyPI
#RUN poetry run pip install RPi.GPIO==0.7.1 --extra-index-url https://www.piwheels.org/simple
RUN poetry install --no-root --only main$(if [ "$DEBUG" = 'true' ]; then echo ',dev'; fi)
#porject.Dockerfile
FROM arm32v6/python:3.11-alpine AS runner
ENV PYTHONUNBUFFERED=1
ENV ENV_PATH=/app/.venv
WORKDIR /app
ENV PATH "/app/.venv/bin:${PATH}"
COPY --from=username/venv $ENV_PATH /app/.venv
.#...
Content type
Image
Digest
sha256:b04ba0e1c…
Size
84.2 MB
Last updated
over 2 years ago
docker pull carrycat/rpi-zero-python:3.11-alpine