Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
Jupyter Docker Stacks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nanahira
Jupyter Docker Stacks
Commits
e8df9912
Commit
e8df9912
authored
Sep 12, 2015
by
Peter Parente
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #31 from parente/early-user-late-uid
Create jovyan in Dockerfile, reset UID at startup
parents
7c9edef4
aec1c748
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
76 additions
and
42 deletions
+76
-42
all-spark-notebook/Dockerfile
all-spark-notebook/Dockerfile
+13
-6
all-spark-notebook/README.md
all-spark-notebook/README.md
+1
-0
datascience-notebook/Dockerfile
datascience-notebook/Dockerfile
+19
-7
datascience-notebook/README.md
datascience-notebook/README.md
+1
-0
minimal-notebook/Dockerfile
minimal-notebook/Dockerfile
+16
-3
minimal-notebook/README.md
minimal-notebook/README.md
+1
-0
minimal-notebook/start-notebook.sh
minimal-notebook/start-notebook.sh
+4
-24
pyspark-notebook/Dockerfile
pyspark-notebook/Dockerfile
+7
-0
pyspark-notebook/README.md
pyspark-notebook/README.md
+1
-0
r-notebook/Dockerfile
r-notebook/Dockerfile
+4
-0
r-notebook/README.md
r-notebook/README.md
+1
-0
scipy-notebook/Dockerfile
scipy-notebook/Dockerfile
+7
-2
scipy-notebook/README.md
scipy-notebook/README.md
+1
-0
No files found.
all-spark-notebook/Dockerfile
View file @
e8df9912
...
...
@@ -49,6 +49,8 @@ ENV R_LIBS_USER $SPARK_HOME/R/lib
ENV
PYTHONPATH $SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.8.2.1-src.zip
ENV
MESOS_NATIVE_LIBRARY /usr/local/lib/libmesos.so
USER
jovyan
# Install Python 3 packages
RUN
conda
install
--yes
\
'ipywidgets=4.0*'
\
...
...
@@ -59,7 +61,7 @@ RUN conda install --yes \
'scikit-learn=0.16*'
\
&&
conda clean
-yt
# Install Python 2 packages
and kernel spec
# Install Python 2 packages
RUN
conda create
-p
$CONDA_DIR
/envs/python2
python
=
2.7
\
'ipython=4.0*'
\
'ipywidgets=4.0*'
\
...
...
@@ -70,9 +72,6 @@ RUN conda create -p $CONDA_DIR/envs/python2 python=2.7 \
'scikit-learn=0.16*'
\
pyzmq
\
&&
conda clean
-yt
RUN
$CONDA_DIR
/envs/python2/bin/python
\
$CONDA_DIR
/envs/python2/bin/ipython
\
kernelspec install-self
# R packages
RUN
conda config
--add
channels r
...
...
@@ -83,5 +82,13 @@ RUN conda install --yes \
'r-rcurl=1.95*'
&&
conda clean
-yt
# Scala Spark kernel spec
RUN
mkdir
-p
/usr/local/share/jupyter/kernels/scala
COPY
kernel.json /usr/local/share/jupyter/kernels/scala/
RUN
mkdir
-p
/opt/conda/share/jupyter/kernels/scala
COPY
kernel.json /opt/conda/share/jupyter/kernels/scala/
USER
root
# Install Python 2 kernel spec globally to avoid permission problems when NB_UID
# switching at runtime.
RUN
$CONDA_DIR
/envs/python2/bin/python
\
$CONDA_DIR
/envs/python2/bin/ipython
\
kernelspec install-self
\ No newline at end of file
all-spark-notebook/README.md
View file @
e8df9912
...
...
@@ -10,6 +10,7 @@
*
ggplot2, rcurl preinstalled for R
*
Spark 1.4.1 for use in local mode or to connect to a cluster of Spark workers
*
Mesos client 0.22 binary that can communicate with a Mesos master
*
Unprivileged user
`jovyan`
(uid=1000, configurable, see options) in group
`users`
(gid=100) with ownership over
`/home/jovyan`
and
`/opt/conda`
*
Options for HTTPS, password auth, and passwordless
`sudo`
## Basic Use
...
...
datascience-notebook/Dockerfile
View file @
e8df9912
...
...
@@ -18,6 +18,8 @@ RUN apt-get update && \
julia
\
libnettle4
&&
apt-get clean
USER
jovyan
# Install Python 3 packages
RUN
conda
install
--yes
\
'ipywidgets=4.0*'
\
...
...
@@ -37,7 +39,7 @@ RUN conda install --yes \
'bokeh=0.9*'
\
&&
conda clean
-yt
# Install Python 2 packages
and kernel spec
# Install Python 2 packages
RUN
conda create
-p
$CONDA_DIR
/envs/python2
python
=
2.7
\
'ipython=4.0*'
\
'ipywidgets=4.0*'
\
...
...
@@ -57,11 +59,8 @@ RUN conda create -p $CONDA_DIR/envs/python2 python=2.7 \
'bokeh=0.9*'
\
pyzmq
\
&&
conda clean
-yt
RUN
$CONDA_DIR
/envs/python2/bin/python
\
$CONDA_DIR
/envs/python2/bin/ipython
\
kernelspec install-self
# R packages
# R packages
including IRKernel which gets installed globally.
RUN
conda config
--add
channels r
RUN
conda
install
--yes
\
'r-base=3.2*'
\
...
...
@@ -82,6 +81,19 @@ RUN conda install --yes \
'r-rcurl=1.95*'
\
'r-randomforest=4.6*'
&&
conda clean
-yt
# IJulia and Julia packages
RUN
julia
-e
'Pkg.add("IJulia")'
# Install IJulia packages as jovyan and then move the kernelspec out
# to the system share location. Avoids problems with runtime UID change not
# taking effect properly on the .local folder in the jovyan home dir.
RUN
julia
-e
'Pkg.add("IJulia")'
&&
\
mv
/home/
$NB_USER
/.local/share/jupyter/kernels/
*
$CONDA_DIR
/share/jupyter/kernels/
&&
\
chmod
-R
go+rx
$CONDA_DIR
/share/jupyter
&&
\
rm
-rf
/home/
$NB_USER
/.local/share
RUN
julia
-e
'Pkg.add("Gadfly")'
&&
julia
-e
'Pkg.add("RDatasets")'
USER
root
# Install Python 2 kernel spec globally to avoid permission problems when NB_UID
# switching at runtime.
RUN
$CONDA_DIR
/envs/python2/bin/python
\
$CONDA_DIR
/envs/python2/bin/ipython
\
kernelspec install-self
\ No newline at end of file
datascience-notebook/README.md
View file @
e8df9912
...
...
@@ -8,6 +8,7 @@
*
Conda R v3.2.x and channel
*
plyr, devtools, dplyr, ggplot2, tidyr, shiny, rmarkdown, forecast, stringr, rsqlite, reshape2, nycflights13, caret, rcurl, and randomforest pre-installed
*
Julia v0.3.x with Gadfly and RDatasets pre-installed
*
Unprivileged user
`jovyan`
(uid=1000, configurable, see options) in group
`users`
(gid=100) with ownership over
`/home/jovyan`
and
`/opt/conda`
*
Options for HTTPS, password auth, and passwordless
`sudo`
## Basic Use
...
...
minimal-notebook/Dockerfile
View file @
e8df9912
...
...
@@ -29,11 +29,14 @@ RUN apt-get update && apt-get install -yq --no-install-recommends \
# Configure environment
ENV
CONDA_DIR /opt/conda
ENV
PATH $CONDA_DIR/bin:$PATH
ENV
NB_USER jovyan
ENV
NB_UID 1000
# Install conda
RUN
echo export
PATH
=
$CONDA_DIR
/bin:
'$PATH'
>
/etc/profile.d/conda.sh
&&
\
RUN
mkdir
-p
$CONDA_DIR
&&
\
echo export
PATH
=
$CONDA_DIR
/bin:
'$PATH'
>
/etc/profile.d/conda.sh
&&
\
wget
--quiet
https://repo.continuum.io/miniconda/Miniconda3-3.9.1-Linux-x86_64.sh
&&
\
/bin/bash /Miniconda3-3.9.1-Linux-x86_64.sh
-b
-p
$CONDA_DIR
&&
\
/bin/bash /Miniconda3-3.9.1-Linux-x86_64.sh
-
f
-
b
-p
$CONDA_DIR
&&
\
rm
Miniconda3-3.9.1-Linux-x86_64.sh
&&
\
$CONDA_DIR
/bin/conda
install
--yes
conda
==
3.14.1
...
...
@@ -43,6 +46,15 @@ RUN conda install --yes \
terminado
\
&&
conda clean
-yt
# Create jovyan user with UID=1000 and in the 'users' group
# Grant ownership over the conda dir and home dir, but stick the group as root.
RUN
useradd
-m
-s
/bin/bash
-N
-u
$NB_UID
$NB_USER
&&
\
mkdir
/home/
$NB_USER
/work
&&
\
mkdir
/home/
$NB_USER
/.jupyter
&&
\
mkdir
/home/
$NB_USER
/.local
&&
\
chown
-R
$NB_USER
:users
$CONDA_DIR
&&
\
chown
-R
$NB_USER
:users /home/
$NB_USER
# Configure container startup
EXPOSE
8888
CMD
[ "start-notebook.sh" ]
...
...
@@ -50,4 +62,5 @@ CMD [ "start-notebook.sh" ]
# Add local files as late as possible to avoid cache busting
COPY
start-notebook.sh /usr/local/bin/
COPY
notebook.conf /etc/supervisor/conf.d/
COPY
jupyter_notebook_config.py /etc/skel/.jupyter/
COPY
jupyter_notebook_config.py /home/$NB_USER/.jupyter/
RUN
chown
-R
$NB_USER
:users /home/
$NB_USER
/.jupyter
\ No newline at end of file
minimal-notebook/README.md
View file @
e8df9912
...
...
@@ -5,6 +5,7 @@
*
Jupyter Notebook server (v4.0.x or v3.2.x, see tag)
*
Conda Python 3.4.x
*
No preinstalled scientific computing packages
*
Unprivileged user
`jovyan`
(uid=1000, configurable, see options) in group
`users`
(gid=100) with ownership over
`/home/jovyan`
and
`/opt/conda`
*
Options for HTTPS, password auth, and passwordless
`sudo`
## Basic Use
...
...
minimal-notebook/start-notebook.sh
View file @
e8df9912
#!/bin/bash
# Constants
NB_USER
=
jovyan
NB_HOME
=
/home/
$NB_USER
NB_WORK
=
$NB_HOME
/work
# Create non-root NB_USER if one doesn't exist
id
-u
$NB_USER
&&
user_exists
=
true
if
[
-z
"
$user_exists
"
]
;
then
useradd
-m
-s
/bin/bash
-u
${
NB_UID
:-
1000
}
$NB_USER
# Setup a work directory rooted in the NB_USER home
mkdir
-p
$NB_WORK
chown
-R
$NB_USER
.
$NB_USER
$NB_HOME
# Allow NB_USER group to update conda root env
chown
-R
root.
$NB_USER
$CONDA_DIR
chmod
g+w
$CONDA_DIR
fi
# Copy skeleton files if useradd didn't do it (e.g., volume mounted dir
# residing in NB_HOME prevented it)
if
[
!
-d
$NB_HOME
/.jupyter
]
;
then
cp
-r
/etc/skel/.
$NB_HOME
chown
-R
$NB_USER
.
$NB_USER
$NB_HOME
# Change UID of jovyan to NB_UID if it does not match
if
[
"
$NB_UID
"
!=
$(
id
-u
jovyan
)
]
;
then
usermod
-u
$NB_UID
$NB_USER
chown
-R
$NB_UID
$CONDA_DIR
fi
# Enable sudo if requested
...
...
pyspark-notebook/Dockerfile
View file @
e8df9912
...
...
@@ -27,6 +27,8 @@ ENV SPARK_HOME /usr/local/spark
ENV
PYTHONPATH $SPARK_HOME/python:$SPARK_HOME/python/lib/py4j-0.8.2.1-src.zip
ENV
MESOS_NATIVE_LIBRARY /usr/local/lib/libmesos.so
USER
jovyan
# Install Python 3 packages
RUN
conda
install
--yes
\
'ipywidgets=4.0*'
\
...
...
@@ -48,6 +50,11 @@ RUN conda create -p $CONDA_DIR/envs/python2 python=2.7 \
'scikit-learn=0.16*'
\
pyzmq
\
&&
conda clean
-yt
USER
root
# Install Python 2 kernel spec globally to avoid permission problems when NB_UID
# switching at runtime.
RUN
$CONDA_DIR
/envs/python2/bin/python
\
$CONDA_DIR
/envs/python2/bin/ipython
\
kernelspec install-self
\ No newline at end of file
pyspark-notebook/README.md
View file @
e8df9912
...
...
@@ -7,6 +7,7 @@
*
pyspark, pandas, matplotlib, scipy, seaborn, scikit-learn pre-installed
*
Spark 1.4.1 for use in local mode or to connect to a cluster of Spark workers
*
Mesos client 0.22 binary that can communicate with a Mesos master
*
Unprivileged user
`jovyan`
(uid=1000, configurable, see options) in group
`users`
(gid=100) with ownership over
`/home/jovyan`
and
`/opt/conda`
*
Options for HTTPS, password auth, and passwordless
`sudo`
## Basic Use
...
...
r-notebook/Dockerfile
View file @
e8df9912
...
...
@@ -13,6 +13,8 @@ RUN apt-get update && \
gfortran
\
gcc
&&
apt-get clean
USER
jovyan
# R packages
RUN
conda config
--add
channels r
RUN
conda
install
--yes
\
...
...
@@ -33,3 +35,5 @@ RUN conda install --yes \
'r-caret=6.0*'
\
'r-rcurl=1.95*'
\
'r-randomforest=4.6*'
&&
conda clean
-yt
USER
root
\ No newline at end of file
r-notebook/README.md
View file @
e8df9912
...
...
@@ -5,6 +5,7 @@
*
Jupyter Notebook server (v4.0.x or v3.2.x, see tag)
*
Conda R v3.2.x and channel
*
plyr, devtools, dplyr, ggplot2, tidyr, shiny, rmarkdown, forecast, stringr, rsqlite, reshape2, nycflights13, caret, rcurl, and randomforest pre-installed
*
Unprivileged user
`jovyan`
(uid=1000, configurable, see options) in group
`users`
(gid=100) with ownership over
`/home/jovyan`
and
`/opt/conda`
*
Options for HTTPS, password auth, and passwordless
`sudo`
## Basic Use
...
...
scipy-notebook/Dockerfile
View file @
e8df9912
...
...
@@ -3,7 +3,7 @@ FROM jupyter/minimal-notebook
MAINTAINER
Jupyter Project <jupyter@googlegroups.com>
USER
root
USER
jovyan
# Install Python 3 packages
RUN
conda
install
--yes
\
...
...
@@ -24,7 +24,7 @@ RUN conda install --yes \
'bokeh=0.9*'
\
&&
conda clean
-yt
# Install Python 2 packages
and kernel spec
# Install Python 2 packages
RUN
conda create
-p
$CONDA_DIR
/envs/python2
python
=
2.7
\
'ipython=4.0*'
\
'ipywidgets=4.0*'
\
...
...
@@ -44,6 +44,11 @@ RUN conda create -p $CONDA_DIR/envs/python2 python=2.7 \
'bokeh=0.9*'
\
pyzmq
\
&&
conda clean
-yt
USER
root
# Install Python 2 kernel spec globally to avoid permission problems when NB_UID
# switching at runtime.
RUN
$CONDA_DIR
/envs/python2/bin/python
\
$CONDA_DIR
/envs/python2/bin/ipython
\
kernelspec install-self
scipy-notebook/README.md
View file @
e8df9912
...
...
@@ -5,6 +5,7 @@
*
Jupyter Notebook server (v4.0.x or v3.2.x, see tag)
*
Conda Python 3.4.x and Python 2.7.x environments
*
pandas, matplotlib, scipy, seaborn, scikit-learn, scikit-image, sympy, cython, patsy, statsmodel, cloudpickle, dill, numba, bokeh pre-installed
*
Unprivileged user
`jovyan`
(uid=1000, configurable, see options) in group
`users`
(gid=100) with ownership over
`/home/jovyan`
and
`/opt/conda`
*
Options for HTTPS, password auth, and passwordless
`sudo`
## Basic Use
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment