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
9e2c479e
Commit
9e2c479e
authored
Dec 16, 2015
by
Kyle Kelley
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #84 from parente/earlier-user
Create jovyan user before conda install
parents
3afdf219
937dc6ef
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 @
9e2c479e
...
@@ -38,31 +38,36 @@ ENV SHELL /bin/bash
...
@@ -38,31 +38,36 @@ ENV SHELL /bin/bash
ENV
NB_USER jovyan
ENV
NB_USER jovyan
ENV
NB_UID 1000
ENV
NB_UID 1000
# Install conda
# Create jovyan user with UID=1000 and in the 'users' group
RUN
mkdir
-p
$CONDA_DIR
&&
\
RUN
useradd
-m
-s
/bin/bash
-N
-u
$NB_UID
$NB_USER
&&
\
echo export
PATH
=
$CONDA_DIR
/bin:
'$PATH'
>
/etc/profile.d/conda.sh
&&
\
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
&&
\
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
-
&&
\
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
&&
\
rm
Miniconda3-3.9.1-Linux-x86_64.sh
&&
\
$CONDA_DIR
/bin/conda
install
--yes
conda
==
3.14.1
$CONDA_DIR
/bin/conda
install
--yes
conda
==
3.14.1
# Install Jupyter notebook
# Install Jupyter notebook
as jovyan
RUN
conda
install
--yes
\
RUN
conda
install
--yes
\
'notebook=4.0*'
\
'notebook=4.0*'
\
terminado
\
terminado
\
&&
conda clean
-yt
&&
conda clean
-yt
# Create jovyan user with UID=1000 and in the 'users' group
USER
root
# 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
# Configure container startup
as root
EXPOSE
8888
EXPOSE
8888
WORKDIR
/home/$NB_USER/work
WORKDIR
/home/$NB_USER/work
ENTRYPOINT
["tini", "--"]
ENTRYPOINT
["tini", "--"]
...
@@ -71,4 +76,7 @@ CMD ["start-notebook.sh"]
...
@@ -71,4 +76,7 @@ CMD ["start-notebook.sh"]
# Add local files as late as possible to avoid cache busting
# Add local files as late as possible to avoid cache busting
COPY
start-notebook.sh /usr/local/bin/
COPY
start-notebook.sh /usr/local/bin/
COPY
jupyter_notebook_config.py /home/$NB_USER/.jupyter/
COPY
jupyter_notebook_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
\ No newline at end of file
# 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