【问题标题】:Anaconda3 Docker: /bin/bash: no such file or directoryAnaconda3 Docker:/bin/bash:没有这样的文件或目录
【发布时间】:2019-04-10 16:11:48
【问题描述】:

我正在尝试将 official docker image 用于 anaconda3。在 dockerhub 上,给出了一个运行 jupyter notebook 的例子:

 docker run -i --rm -t -p 8888:8888 continuumio/anaconda3 /bin/bash -c "/opt/conda/bin/conda install jupyter -y --quiet && mkdir /opt/notebooks && /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip='*' --port=8888 --no-browser"

但它会随着消息退出

docker: Error response from daemon: OCI runtime create failed: container_linux.go:348: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown.

另外,我无法使用bashapt-get 和其他各种命令行工具。为什么?

【问题讨论】:

    标签: docker debian jupyter-notebook anaconda alpine


    【解决方案1】:

    Continuum 最近决定将他们的基础镜像从 debian 切换到 alpine linux(参见 this issue on GitHub)。因此,需要更换一些命令行工具:

    • bash -> sh
    • apt-get -> apk

    你可以像这样使用 docker anaconda3 启动一个 jupyter notebook:

    docker run -i --rm -t -p 8888:8888 continuumio/anaconda3 /bin/sh -c "/opt/conda/bin/conda install jupyter -y --quiet && mkdir /opt/notebooks && /opt/conda/bin/jupyter notebook --notebook-dir=/opt/notebooks --ip='0.0.0.0' --port=8888 --no-browser"
    

    ...并访问http://localhost:8888/

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-16
      • 2021-10-24
      • 2016-04-18
      • 2016-05-03
      • 1970-01-01
      • 1970-01-01
      • 2021-05-17
      相关资源
      最近更新 更多