Docker with conda env
efyphil opened this issue · 3 comments
I try to use docker with jupyter like this
nvidia-docker run -it --net=host -p 8087:8087 -v ~/learningrigidity/:/rigidity learningrigidity:1.10 bash -ci ". /opt/conda/etc/profile.d/conda.sh && conda activate rigidity && jupyter lab --port 8087 --ip=0.0.0.0 --no-browser --allow-root"
So i have problem: in terminal I had valid python 2.7.15 with anaconda, but when I tried to import torch in notebook I had problem with that.
Also I have this additional information in Dockerfile for jupyter
RUN DEBIAN_FRONTEND=noninteractive && apt-get update -y && apt-get install -y --no-install-recommends
build-essential
git
vim
wget
RUN . /opt/conda/etc/profile.d/conda.sh
conda install ipykernel
conda install nb_conda
conda install -u jupyter jupyter lab
RUN rm -rf /rigidity
ENV PATH /opt/conda/envs/env/bin:$PATH
RUN curl -O https://bootstrap.pypa.io/get-pip.py &&
python get-pip.py &&
rm get-pip.py
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y python-pip
RUN DEBIAN_FRONTEND=noninteractive python -m pip install --upgrade pip
RUN DEBIAN_FRONTEND=noninteractive pip install -U jupyter && pip install jupyterlab
RUN DEBIAN_FRONTEND=noninteractive python -m ipykernel install --user --name mykernel
ENV PATH /opt/conda/envs/rigidity/:$PATH
I did not understand your actual issue exactly. Does the other option using conda environment config works for you?
Actually, docker was work for me, when I use bash, but when I try to use Jupyter environment inside docker didn't start. It is not a big problem, at all, but I think maybe you have special docker with jupyter :)
Sorry no. I did not use jupyter with docker in my development. The docker image was only created for the purpose of simplifying the install stage. If you find a good solution, please also let me know.
Glad to know it's not causing trouble for you. :)