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
937dc6ef
Commit
937dc6ef
authored
Dec 16, 2015
by
Peter Parente
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create jovyan user before conda install
Avoids costly chown, fixes #81 (c) Copyright IBM Corp. 2015
parent
3afdf219
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
+23
-15
minimal-notebook/Dockerfile
minimal-notebook/Dockerfile
+23
-15
No files found.
minimal-notebook/Dockerfile
View file @
937dc6ef
...
...
@@ -38,31 +38,36 @@ ENV SHELL /bin/bash
ENV
NB_USER jovyan
ENV
NB_UID 1000
# Install conda
RUN
mkdir
-p
$CONDA_DIR
&&
\
echo export
PATH
=
$CONDA_DIR
/bin:
'$PATH'
>
/etc/profile.d/conda.sh
&&
\
# Create jovyan user with UID=1000 and in the 'users' group
RUN
useradd
-m
-s
/bin/bash
-N
-u
$NB_UID
$NB_USER
&&
\
mkdir
-p
/opt/conda
&&
\
chown
jovyan /opt/conda
USER
jovyan
# Setup jovyan home directory
RUN
mkdir
/home/
$NB_USER
/work
&&
\
mkdir
/home/
$NB_USER
/.jupyter
&&
\
mkdir
/home/
$NB_USER
/.local
# Install conda as jovyan
RUN
cd
/tmp
&&
\
mkdir
-p
$CONDA_DIR
&&
\
wget
--quiet
https://repo.continuum.io/miniconda/Miniconda3-3.9.1-Linux-x86_64.sh
&&
\
echo
"6c6b44acdd0bc4229377ee10d52c8ac6160c336d9cdd669db7371aa9344e1ac3 *Miniconda3-3.9.1-Linux-x86_64.sh"
|
sha256sum
-c
-
&&
\
/bin/bash
/
Miniconda3-3.9.1-Linux-x86_64.sh
-f
-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
# Install Jupyter notebook
# Install Jupyter notebook
as jovyan
RUN
conda
install
--yes
\
'notebook=4.0*'
\
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
USER
root
# Configure container startup
# Configure container startup
as root
EXPOSE
8888
WORKDIR
/home/$NB_USER/work
ENTRYPOINT
["tini", "--"]
...
...
@@ -71,4 +76,7 @@ CMD ["start-notebook.sh"]
# Add local files as late as possible to avoid cache busting
COPY
start-notebook.sh /usr/local/bin/
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
RUN
chown
-R
$NB_USER
:users /home/
$NB_USER
/.jupyter
# Stay as root so that the start-notebook.sh command can properly change
# jovyan to a configurable NB_UID and grant 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