我试图在我的M1上修改一个带有第三方cli (塑料外壳)的烧瓶应用程序。
我使用了ubuntu:18.04作为基本图像。在最近的版本上构建将失败,错误消息是“没有找到安装候选”。我注意到的第一件奇怪的事情是,完全相同的构建将在linux服务器上成功。
我使用本地as来完成应用程序,当我开始修改所有内容时,我得到了以下错误:
#16 22.37注意:这个错误来自一个子进程,很可能不是pip的问题。
#16 22.37错误: pylibjpeg-libjpeg的建筑车轮失效
#16 22.37未能建立pylibjpeg-openjpeg pylibjpeg-libjpeg
#16 22.37错误:无法为pylibjpeg-openjpeg,pylibjpeg-libjpeg构建车轮,这是安装pyproject.toml项目所必需的。
这些python包是处理图像的不同C++库的包装器。本地构建失败,我们的linux服务器上的构建运行得非常好。
在本地开发过程中,是否有人注意到类似的问题?有什么解决办法吗?
下面是已使用的Dockerfile和requirements.txt (当前缺少特定版本)的引用:
FROM ubuntu:18.04 as base
RUN apt-get update -y && apt-get install -y && apt-get upgrade -y
RUN apt-get install -y software-properties-common
RUN add-apt-repository ppa:deadsnakes/ppa
RUN apt-get install -y python3.8 python3-pip
RUN rm /usr/bin/python3 && ln -s /usr/bin/python3.8 /usr/bin/python3
RUN apt-get install -y \
plastimatch \
zlib1g \
cmake
WORKDIR /app
COPY requirements.txt requirements.txt
RUN python3 -m pip install -U --force-reinstall pip
RUN pip3 install --upgrade pip setuptools wheel
RUN pip3 install -r requirements.txt
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8
FROM base as upload-dev
RUN echo "Building dev version"
COPY requirements_dev.txt requirements_dev.txt
RUN pip3 install -r requirements_dev.txt
COPY . .python-dotenv
cython
pynrrd
flask-cors
Flask
Werkzeug
httplib2
numpy
pydicom
highdicom
dicomweb-client最新情况: 01。2022年7月
我可以追踪错误。问题是一些第三方图书馆的轮子不见了。如果无法找到轮子,则源代码将由编译器获取和安装。在安装以C++为核心的库时,这在我的计算机上崩溃了。解决这个问题的一个简单方法是直接使用linux AMD64映像。
FROM --platform=linux/amd64 $YOUR_BASE_IMAGE这会稍微慢一点,但对于大多数开发环境来说都足够了。详细解释:https://pythonspeed.com/articles/docker-build-problems-mac/
发布于 2022-08-16 15:54:58
对我来说,修复方法是安装Rosetta 2,它包含在Docker文档中:https://docs.docker.com/desktop/mac/apple-silicon/#system-requirements
softwareupdate --install-rosettahttps://stackoverflow.com/questions/72714490
复制相似问题