我想通过在 docker ubuntu 中使用 Anaconda3 来使用 jupyter notbook,但是当我使用
docker build --platform linux/amd64 .
创建图像时,会出现以下错误。
如何解决?
#8 141.1
#8 141.1 2022-05-05 04:21:55 (3.62 MB/s) - 'Anaconda3-2019.10-Linux-x86_64.sh' saved [530308481/530308481]
#8 141.1
#8 141.3 PREFIX=/opt/anaconda3
#8 143.4 Unpacking payload ...
[96] Failed to execute script entry_point concurrent.futures.process._RemoteTraceback:
#8 151.7 '''
#8 151.7 Traceback (most recent call last):
#8 151.7 File "concurrent/futures/process.py", line 367, in _queue_management_worker
#8 151.7 File "multiprocessing/connection.py", line 251, in recv
#8 151.7 TypeError: __init__() missing 1 required positional argument: 'msg'
#8 151.7 '''
#8 151.7
#8 151.7 The above exception was the direct cause of the following exception:
#8 151.7
#8 151.7 Traceback (most recent call last):
#8 151.7 File "entry_point.py", line 71, in <module>
#8 151.7 File "concurrent/futures/process.py", line 483, in _chain_from_iterable_of_lists
#8 151.7 File "concurrent/futures/_base.py", line 598, in result_iterator
#8 151.7 File "concurrent/futures/_base.py", line 435, in result
#8 151.7 File "concurrent/futures/_base.py", line 384, in __get_result
#8 151.7 concurrent.futures.process.BrokenProcessPool: A process in the process pool was terminated abruptly while the future was running or pending.
------ executor failed running [/bin/sh -c wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh && sh /opt/Anaconda3-2019.10-Linux-x86_64.sh -b -p /opt/anaconda3 && rm -f Anaconda3-2019.10-Linux-x86_64.sh]: exit code: 1
Dockerfile 如下所示:
FROM ubuntu:latest
# update
RUN apt-get -y update && apt-get install -y \
sudo \
wget \
vim
#install anaconda3
WORKDIR /opt
# download anaconda package and install anaconda
# archive -> https://repo.continuum.io/archive/
RUN wget https://repo.anaconda.com/archive/Anaconda3-2019.10-Linux-x86_64.sh && \
sh /opt/Anaconda3-2019.10-Linux-x86_64.sh -b -p /opt/anaconda3 && \
rm -f Anaconda3-2019.10-Linux-x86_64.sh
# set path
ENV PATH /opt/anaconda3/bin:$PATH
# update pip and conda
RUN pip install --upgrade pip
WORKDIR /
RUN mkdir /work
# execute jupyterlab as a default command
CMD ["jupyter", "lab", "--ip=0.0.0.0", "--allow-root", "--LabApp.token=''"]
Mac 12.3.1 苹果 M1
适用于 Mac 4.7.1 的 Docker 桌面
这可能是安装过程中的空间问题,我收到了确切的错误。如果您接受在“默认路径”上安装 Anaconda 的默认选项,Anaconda 将安装在您的用户主目录中,其中空间可能会成为问题。对我来说,在安装过程中将默认目录更改为其他目录时,问题得到了解决。您也可以参考此页面了解类似问题 - https://github.com/conda/conda/issues/10143
将 python 版本更新为所需的版本,然后再次下载安装程序,这对我有用