JupyterHub does not pass all of its environment variables to the
single-user servers, because it is likely to include hub-level credentials
that the user shouldn’t have access to. For this reason, there is a
c.Spawner.env_keep configurable that is a whitelist of environment
variables that *should* be passed down. You can specify that JAVA_HOME
should be added with:

c.Spawner.env_keep.append('JAVA_HOME')

in your jupyterhub_config.py
​

On Thu, Sep 8, 2016 at 7:41 PM, Changtao Hou <[email protected]> wrote:

> Hi,
>
>       I try to create a jupyterhub docker container. I setup the JAVA_HOME
> environment variable in my dockerfile and the docker container build
> success. But when I use the docker image and found the JAVA_HOME
> environment variable still need to be set manual. Could anyone help me?
>       The dockerfile I used is :
>
> FROM krylov-jupyter-ares
> RUN pip install numpy pandas scipy scikit-learn sympy statsmodels && \
>     pip install git+git://github.com/Theano/Theano.git --upgrade
> --no-deps && pip install keras && \
>     curl https://storage.googleapis.com/tensorflow/linux/cpu/
> tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl -o
> /tmp/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl && \
>     pip install /tmp/tensorflow-0.9.0-cp35-cp35m-linux_x86_64.whl
>
> RUN mkdir -p /tools/node && \
>     wget -nv https://nodejs.org/dist/v4.3.2/node-v4.3.2-linux-x64.tar.gz
> -O node.tar.gz && \
>     tar xzf node.tar.gz -C /tools/node --strip-components=1 && \
>     rm node.tar.gz && \
>     /tools/node/bin/npm install -g configurable-http-proxy
>
> RUN pip install jupyterhub && \
>     pip install seaborn && \
>     pip install matplotlib && \
>     pip install xgboost && \
>     pip install tqdm
>
> RUN jupyterhub --generate-config && \
>     mkdir /data && \
>     echo "" | adduser --disabled-password chhou && \
>     ln -s /opt/krylov/jupyter/notebooks /home/chhou/notebooks && \
>     usermod -aG sudo chhou
>
> RUN echo chhou:password >> /tmp/pw && \
>     chpasswd < /tmp/pw && \
>     chmod a+rwx /opt/krylov/jupyter/notebooks && \
>     chmod -R a+rw /opt/krylov/jupyter/notebooks
>
> EXPOSE 8000
>
> ENV PATH $PATH:/tools/node/bin
> ENV JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64/jre
>
> RUN echo "PATH=$PATH" >> /etc/environment && \
>          echo "JAVA_HOME=$JAVA_HOME" >> /etc/environment
>
> WORKDIR /opt/krylov/jupyter/notebooks
> ENTRYPOINT ["jupyterhub", "--no-ssl"]
>
>          The build command I used is: sudo docker build -f dockerfile .
>
>          Any links or comments will be appreciated.
>
>
>
>
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Project Jupyter" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/jupyter/4fe6c0b2-5c54-4d59-97a7-5c28470b0f3d%40googlegroups.com
> <https://groups.google.com/d/msgid/jupyter/4fe6c0b2-5c54-4d59-97a7-5c28470b0f3d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/CAHNn8BW61J_-_q9aa2psQx2C0pdzAo_7A7qPPz3e4stgzo8z0w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to