用于在 rasp pi 硬件上安装 scikit-learn 的 Dockerfile

问题描述 投票:0回答:1

如何为可以安装 scikit-learn 的 Raspbian 硬件制作 Dockerfile?我对 debian-slim 或 Alpine Linux 镜像没有任何运气。

# Use a base image for Raspberry Pi with Alpine Linux
FROM arm32v6/alpine:3.14

# Update package repositories and install necessary dependencies
RUN apk --no-cache update && \
    apk --no-cache add python3 python3-dev py3-pip build-base gcc gfortran wget freetype-dev libpng-dev openblas-dev && \
    ln -s /usr/include/locale.h /usr/include/xlocale.h

# Install scikit-learn and bacpypes3 using pip3
RUN pip3 install scikit-learn bacpypes3

# Clean up by removing unnecessary packages and cache
RUN apk del python3-dev py3-pip build-base gcc gfortran && \
    rm -rf /var/cache/apk/*

# Set the working directory
WORKDIR /app

# Start your application
CMD ["python3", "bacnet_server.py"]
python docker numpy scikit-learn raspbian
1个回答
0
投票

您可以使用APK来安装

scikit-learn

来自文档

sudo apk add py3-scikit-learn

安装 python3 包。

© www.soinside.com 2019 - 2024. All rights reserved.