Commit 384d5240 authored by Michael Poplavski's avatar Michael Poplavski

Modified entrypoint of minimal kernel.

Contribution (c) Copyright IBM Corp. 2016
parent 9698d1af
...@@ -38,11 +38,10 @@ RUN pip3 install jupyter_kernel_gateway==0.2.0 ...@@ -38,11 +38,10 @@ RUN pip3 install jupyter_kernel_gateway==0.2.0
USER $NB_USER USER $NB_USER
EXPOSE 8888 EXPOSE 8888
WORKDIR /home/$NB_USER/work WORKDIR /home/$NB_USER/work
ENTRYPOINT ["tini", "--"] ENTRYPOINT ["tini", "--", "jupyter", "kernelgateway"]
CMD ["/usr/local/bin/start-notebook.sh"] CMD ["--KernelGatewayApp.ip=0.0.0.0"]
# Add local files as late as possible to avoid cache busting # Add local files as late as possible to avoid cache busting
USER root USER root
COPY start-notebook.sh /usr/local/bin/
COPY jupyter_kernel_gateway_config.py /home/$NB_USER/.jupyter/ COPY jupyter_kernel_gateway_config.py /home/$NB_USER/.jupyter/
RUN chown -R $NB_USER:users /home/$NB_USER/.jupyter RUN chown -R $NB_USER:users /home/$NB_USER/.jupyter
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* [Jupyter Kernel Gateway](https://github.com/jupyter-incubator/kernel_gateway) that spawns minimal Jupyter Python kernel * [Jupyter Kernel Gateway](https://github.com/jupyter-incubator/kernel_gateway) that spawns minimal Jupyter Python kernel
* No preinstalled scientific computing packages * No preinstalled scientific computing packages
* Unprivileged user `jovyan` (uid=1000, configurable, see options) in group `users` (gid=100) with ownership over `/home/jovyan` * Unprivileged user `jovyan` (uid=1000, configurable, see options) in group `users` (gid=100) with ownership over `/home/jovyan`
* [tini](https://github.com/krallin/tini) as the container entrypoint and [start.sh](./start.sh) as the default command * [tini](https://github.com/krallin/tini) as the container entrypoint
* Options for Port and Ip address * Options for Port and Ip address
......
#!/bin/bash
# Change UID of NB_USER to NB_UID if it does not match
if [ "$NB_UID" != $(id -u $NB_USER) ] ; then
usermod -u $NB_UID $NB_USER
fi
# Enable sudo if requested
if [ ! -z "$GRANT_SUDO" ]; then
echo "$NB_USER ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/notebook
fi
# Start the notebook server
exec su $NB_USER -c "env PATH=$PATH jupyter kernelgateway $@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment