【发布时间】:2021-10-15 13:54:47
【问题描述】:
我想基于 Python 3.8 映像构建 Docker 映像,然后在 ARM/V7 平台上安装一些要求,包括 Pandas。但是当涉及到安装 pip 要求时,这个过程就卡住了。
有没有办法使用不同的基础镜像或更改 Docker 文件中的其他内容以在具有 ARM/V7 架构的设备上的 Docker 镜像中运行 pandas?
这里是 dockerfile:
FROM python:3.8@sha256:45fbccbc4681e8d9ef517d43f9d0eb8f17b2beac00b0f9697bbf85354ae8a266
WORKDIR /app
EXPOSE 8002/tcp
COPY requirements.txt requirements.txt
RUN pip install -r requirements.txt
COPY . .
CMD ["python3", "-m", "monitoring"]
requirements.txt:
pandas==1.3.3
requests==2.26.0
当我使用docker build -t rfu . 构建图像时,我得到以下输出:
Sending build context to Docker daemon 25.6kB
Step 1/7 : FROM python:3.8@sha256:45fbccbc4681e8d9ef517d43f9d0eb8f17b2beac00b0f9697bbf85354ae8a266
---> 0c665e140292
Step 2/7 : WORKDIR /app
---> Running in a5e6772c20f9
Removing intermediate container a5e6772c20f9
---> 5e7807e6f975
Step 3/7 : EXPOSE 8002/tcp
---> Running in d9f6cdc8aca1
Removing intermediate container d9f6cdc8aca1
---> bcd057ff5d87
Step 4/7 : COPY requirements.txt requirements.txt
---> d11ccce85d46
Step 5/7 : RUN pip install -r requirements.txt
---> Running in cd920fa4c18d
Collecting pandas==1.3.3
Downloading pandas-1.3.3.tar.gz (4.7 MB)
Installing build dependencies: started
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
Installing build dependencies: still running...
这是进程卡住的地方。
【问题讨论】: