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
2eee78f7
Commit
2eee78f7
authored
Jun 04, 2017
by
Peter Parente
Committed by
GitHub
Jun 04, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #388 from minrk/nothing-in-home
finish removing files from $HOME
parents
11be019e
877a95d1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
64 deletions
+8
-64
base-notebook/Dockerfile
base-notebook/Dockerfile
+3
-4
base-notebook/start.sh
base-notebook/start.sh
+5
-1
scipy-notebook/Dockerfile
scipy-notebook/Dockerfile
+0
-4
scipy-notebook/mplimporthook.py
scipy-notebook/mplimporthook.py
+0
-55
No files found.
base-notebook/Dockerfile
View file @
2eee78f7
...
@@ -52,9 +52,8 @@ RUN useradd -m -s /bin/bash -N -u $NB_UID $NB_USER && \
...
@@ -52,9 +52,8 @@ RUN useradd -m -s /bin/bash -N -u $NB_UID $NB_USER && \
USER
$NB_USER
USER
$NB_USER
# Setup jovyan home directory
# Setup work directory for backward-compatibility
RUN
mkdir
/home/
$NB_USER
/work
&&
\
RUN
mkdir
/home/
$NB_USER
/work
echo
"cacert=/etc/ssl/certs/ca-certificates.crt"
>
/home/
$NB_USER
/.curlrc
# Install conda as jovyan
# Install conda as jovyan
RUN
cd
/tmp
&&
\
RUN
cd
/tmp
&&
\
...
@@ -77,7 +76,7 @@ RUN conda install --quiet --yes \
...
@@ -77,7 +76,7 @@ RUN conda install --quiet --yes \
USER
root
USER
root
EXPOSE
8888
EXPOSE
8888
WORKDIR
/home/$NB_USER/work
WORKDIR
$HOME
# Configure container startup
# Configure container startup
ENTRYPOINT
["tini", "--"]
ENTRYPOINT
["tini", "--"]
...
...
base-notebook/start.sh
View file @
2eee78f7
...
@@ -9,7 +9,11 @@ if [ $UID == 0 ] ; then
...
@@ -9,7 +9,11 @@ if [ $UID == 0 ] ; then
# Change UID of NB_USER to NB_UID if it does not match
# Change UID of NB_USER to NB_UID if it does not match
if
[
"
$NB_UID
"
!=
$(
id
-u
$NB_USER
)
]
;
then
if
[
"
$NB_UID
"
!=
$(
id
-u
$NB_USER
)
]
;
then
usermod
-u
$NB_UID
$NB_USER
usermod
-u
$NB_UID
$NB_USER
chown
-R
$NB_UID
$CONDA_DIR
for
d
in
"
$CONDA_DIR
"
"
$JULIA_PKGDIR
"
;
do
if
[[
!
-z
"
$d
"
&&
-d
"
$d
"
]]
;
then
chown
-R
$NB_UID
"
$d
"
fi
done
fi
fi
# Change GID of NB_USER to NB_GID if NB_GID is passed as a parameter
# Change GID of NB_USER to NB_GID if NB_GID is passed as a parameter
...
...
scipy-notebook/Dockerfile
View file @
2eee78f7
...
@@ -86,10 +86,6 @@ RUN ln -s $CONDA_DIR/envs/python2/bin/pip $CONDA_DIR/bin/pip2 && \
...
@@ -86,10 +86,6 @@ RUN ln -s $CONDA_DIR/envs/python2/bin/pip $CONDA_DIR/bin/pip2 && \
ENV
XDG_CACHE_HOME /home/$NB_USER/.cache/
ENV
XDG_CACHE_HOME /home/$NB_USER/.cache/
RUN
MPLBACKEND
=
Agg
$CONDA_DIR
/envs/python2/bin/python
-c
"import matplotlib.pyplot"
RUN
MPLBACKEND
=
Agg
$CONDA_DIR
/envs/python2/bin/python
-c
"import matplotlib.pyplot"
# Configure ipython kernel to use matplotlib inline backend by default
RUN
mkdir
-p
$HOME
/.ipython/profile_default/startup
COPY
mplimporthook.py $HOME/.ipython/profile_default/startup/
USER
root
USER
root
# Install Python 2 kernel spec globally to avoid permission problems when NB_UID
# Install Python 2 kernel spec globally to avoid permission problems when NB_UID
...
...
scipy-notebook/mplimporthook.py
deleted
100644 → 0
View file @
11be019e
"""Startup script for IPython kernel.
Installs an import hook to configure the matplotlib backend on the fly.
Originally from @minrk at
https://github.com/minrk/profile_default/blob/master/startup/mplimporthook.py
Repurposed for docker-stacks to address repeat bugs like
https://github.com/jupyter/docker-stacks/issues/235.
"""
import
sys
from
IPython
import
get_ipython
class
MatplotlibFinder
(
object
):
"""Import hook that notices when matplotlib.pyplot or pylab is imported
and tries to configure the matplotlib backend appropriately for the
environment.
"""
_called
=
False
def
find_module
(
self
,
fullname
,
path
=
None
):
if
self
.
_called
:
# already handled
return
if
fullname
not
in
(
'pylab'
,
'matplotlib.pyplot'
):
# not matplotlib
return
# don't call me again
self
.
_called
=
True
try
:
# remove myself from the import hooks
sys
.
meta_path
=
[
loader
for
loader
in
sys
.
meta_path
if
loader
is
not
self
]
except
ValueError
:
pass
ip
=
get_ipython
()
if
ip
is
None
:
# not in an interactive environment
return
if
ip
.
pylab_gui_select
:
# backend already selected
return
if
hasattr
(
ip
,
'kernel'
):
# default to inline in kernel environments
ip
.
enable_matplotlib
(
'inline'
)
else
:
print
(
'enabling matplotlib'
)
ip
.
enable_matplotlib
()
# install the finder immediately
sys
.
meta_path
.
insert
(
0
,
MatplotlibFinder
())
\ No newline at end of file
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