我一直在尝试在旧的 Raspberry Pi 2B 的 Docker 映像中安装numpy,pandas和。scipy当 pip 尝试安装它们时,问题就出现了,它需要花费很多时间(甚至失败)。我一直在使用的 Dockerfile 是:
FROM arm32v7/python:3.7-slim-buster
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1
# Install pip requirements
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Workdir
WORKDIR /book
# Switching to a non-root user
RUN useradd appuser && chown -R appuser /book
USER appuser
# During debugging, this entry point …Run Code Online (Sandbox Code Playgroud)