Skip to content

Instantly share code, notes, and snippets.

@vaaaaanquish
Created September 17, 2021 11:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vaaaaanquish/1f4fad6ae58645106d78dd6c2bed3702 to your computer and use it in GitHub Desktop.
Save vaaaaanquish/1f4fad6ae58645106d78dd6c2bed3702 to your computer and use it in GitHub Desktop.
Dockerfile Example of Rust and Python on Jupyter Lab

Dockerfile example

install

  • Rust latest
  • Python 3.7.7
  • Jupyter Lab
  • evcxr_juypyter (Rust Kernel)

Usage

docker build -t example .
docker run -p 8888:8888 -v $PWD:/app -it example

kick jupyterlab

$ jupyter lab --allow-root --ip 0.0.0.0

access to http://127.0.0.1:8888/lab

FROM rust:latest
WORKDIR /app
RUN apt update &&\
rm -rf ~/.cache &&\
apt clean all &&\
apt install -y cmake &&\
apt install -y clang
RUN apt install -y build-essential libffi-dev libssl-dev zlib1g-dev liblzma-dev libbz2-dev libreadline-dev libsqlite3-dev libopencv-dev tk-dev git
# install python
ENV HOME="/root"
ENV PYENV_ROOT="$HOME/.pyenv"
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
RUN git clone https://github.com/pyenv/pyenv.git $HOME/.pyenv
RUN echo 'eval "$(pyenv init -)"' >> ~/.bashrc
RUN eval "$(pyenv init -)"
RUN pyenv install 3.7.7
RUN pyenv global 3.7.7
# jupyterlab, evcxr
RUN pip install jupyterlab
RUN cargo install evcxr_jupyter --no-default-features
RUN evcxr_jupyter --install
ENTRYPOINT [ "/bin/bash" ]
@dskkato
Copy link

dskkato commented Oct 5, 2021

RUN cargo install evcxr_jupyter --no-default-features

の前にlibzmqのインストールが必要かもしれない。

RUN apt install -y libzmq3-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment