--When building an environment with Docker and writing python code, jupyter notebook is easy to see the result of the image --When I tried to simulate using a module called opticspy, pip install was a prerequisite. - https://github.com/Sterncat/opticspy --Jupyter is usually used in the anaconda environment, so I dealt with it while investigating what to do.
Dockerfile
FROM continuumio/anaconda3:latest
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y \
git \
make \
build-essential \
libssl-dev \
zlib1g-dev \
libbz2-dev \
libreadline-dev \
libsqlite3-dev \
wget \
curl \
llvm \
libncurses5-dev \
libncursesw5-dev \
xz-utils \
tk-dev \
libffi-dev \
liblzma-dev \
vim
RUN conda create -n p37 python=3.7 pip
terminal.sh
$ docker run -it -p 8881:8881 -v /hogehoge/:/mnt/ --name pip_in_conda pip_in_conda:1.0
$ source activate p37
$ pip install jupyter
$ pip install environment_kernels
$ jupyter notebook --generate-config
$ vim /root/.jupyter/jupyter_notebook_config.py
The contents to be added with vim are as follows
jupyter_notebook_config.py
c.NotebookApp.kernel_spec_manager_class='environment_kernels.EnvironmentKernelSpecManager'
c.EnvironmentKernelSpecManager.env_dirs=['/opt/conda/envs/']
terminal.sh
$ pip install cffi
$ pip install numpy
$ pip install git+git://github.com/Sterncat/opticspy.git@master
$ pip install pyyaml
$ jupyter notebook --port 8881 --ip=0.0.0.0 --allow-root

Recommended Posts