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
5bc8eb18
Commit
5bc8eb18
authored
Aug 30, 2015
by
Peter Parente
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make jovyan name / paths constant
parent
701212db
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
13 deletions
+14
-13
minimal-notebook/Dockerfile
minimal-notebook/Dockerfile
+1
-5
minimal-notebook/notebook.conf
minimal-notebook/notebook.conf
+2
-2
minimal-notebook/start-notebook.sh
minimal-notebook/start-notebook.sh
+11
-6
No files found.
minimal-notebook/Dockerfile
View file @
5bc8eb18
...
@@ -26,12 +26,8 @@ RUN apt-get update && apt-get install -yq --no-install-recommends \
...
@@ -26,12 +26,8 @@ RUN apt-get update && apt-get install -yq --no-install-recommends \
sudo
\
sudo
\
&&
apt-get clean
&&
apt-get clean
# Configure
docker
environment
# Configure environment
ENV
CONDA_DIR /opt/conda
ENV
CONDA_DIR /opt/conda
ENV
NB_USER jovyan
ENV
NB_HOME /home/$NB_USER
ENV
NB_WORK $NB_HOME/work
ENV
WORK $NB_WORK
ENV
PATH $CONDA_DIR/bin:$PATH
ENV
PATH $CONDA_DIR/bin:$PATH
# Install conda
# Install conda
...
...
minimal-notebook/notebook.conf
View file @
5bc8eb18
[
program
:
notebook
]
[
program
:
notebook
]
user
=
jovyan
user
=
jovyan
umask
=
0002
umask
=
0002
directory
=
%(
ENV_WORK
)
s
directory
=
/
home
/
jovyan
/
work
command
=
ipython
notebook
command
=
ipython
notebook
autostart
=
true
autostart
=
true
autorestart
=
true
autorestart
=
true
stdout_logfile
=/
var
/
log
/
supervisor
/%(
program_name
)
s
.
log
stdout_logfile
=/
var
/
log
/
supervisor
/%(
program_name
)
s
.
log
redirect_stderr
=
true
redirect_stderr
=
true
environment
=
HOME
=
"/home/
%(ENV_NB_USER)s"
,
USER
=
"%(ENV_NB_USER)s
"
environment
=
HOME
=
"/home/
jovyan"
,
USER
=
"jovyan"
,
SHELL
=
"/bin/bash
"
minimal-notebook/start-notebook.sh
View file @
5bc8eb18
#!/bin/bash
#!/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
# Create non-root NB_USER if one doesn't exist
id
-u
$NB_USER
&&
user_exists
=
true
id
-u
$NB_USER
&&
user_exists
=
true
if
[
-z
"
$user_exists
"
]
;
then
if
[
-z
"
$user_exists
"
]
;
then
useradd
-m
-s
/bin/bash
-u
${
NB_UID
:-
1000
}
$NB_USER
useradd
-m
-s
/bin/bash
-u
${
NB_UID
:-
1000
}
$NB_USER
# Setup a work directory rooted in the NB_USER home
# Setup a work directory rooted in the NB_USER home
mkdir
-p
$WORK
mkdir
-p
$
NB_
WORK
chown
-R
jovyan.jovyan
$NB_HOME
chown
-R
$NB_USER
.
$NB_USER
$NB_HOME
# Allow
"jovyan"
group to update conda root env
# Allow
NB_USER
group to update conda root env
chown
-R
root.
jovyan
$CONDA_DIR
chown
-R
root.
$NB_USER
$CONDA_DIR
chmod
g+w
$CONDA_DIR
chmod
g+w
$CONDA_DIR
fi
fi
# Copy skeleton files if useradd didn't do it (e.g., volume mounted dir
# Copy skeleton files if useradd didn't do it (e.g., volume mounted dir
# residing in
/home/jovyan
prevented it)
# residing in
NB_HOME
prevented it)
if
[
!
-d
$NB_HOME
/.jupyter
]
;
then
if
[
!
-d
$NB_HOME
/.jupyter
]
;
then
cp
-r
/etc/skel/.
$NB_HOME
cp
-r
/etc/skel/.
$NB_HOME
chown
-R
jovyan.jovyan
$NB_HOME
chown
-R
$NB_USER
.
$NB_USER
$NB_HOME
fi
fi
# Enable sudo if requested
# Enable sudo if requested
...
...
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