简体   繁体   English

如何在 Dockerfile 中激活 conda venv? (未找到点)

[英]How can I activate conda venv in Dockerfile? (pip not found)

I'm trying to build a docker image like我正在尝试构建一个 docker 图像,例如

FROM ubuntu:latest
RUN apt update && apt upgrade -y && \
        apt install -y git wget libsuitesparse-dev gcc g++ swig && \
        cd ~ && wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
        sh Miniconda3-latest-Linux-x86_64.sh -b && rm Miniconda3-latest-Linux-x86_64.sh && \
        PATH=$PATH:~/miniconda3/condabin && \
        conda init bash && conda upgrade -y conda && /bin/bash -c "source ~/.bashrc" && \
        pip install numpy scipy matplotlib scikit_umfpack

However, /bin/bash -c "source ~/.bashrc" does not work... so I got /bin/sh: 1: pip: not found How can I build a docker image installing miniconda and python requirements using pip at the same time? However, /bin/bash -c "source ~/.bashrc" does not work... so I got /bin/sh: 1: pip: not found How can I build a docker image installing miniconda and python requirements using pip at同时?

I would recommend using a pre-existing Docker image that already has Anaconda installed.我建议使用已经安装了 Anaconda 的预先存在的 Docker 映像。 For example, this link has a Docker image endorsed by Anaconda itself.例如,此链接有一个 Docker 图像,由 Anaconda 本身认可。 There may be others on Dockerhub that also have Anaconda installed already. Dockerhub 上可能还有其他人也已经安装了 Anaconda。 In the case you already tried an image with Anaconda and it didn't meet your needs, let me know.如果您已经尝试过使用 Anaconda 的图像但它不能满足您的需求,请告诉我。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM