Skip to content

Commit bd5824c

Browse files
authored
Merge pull request #16 from kwankyu/master
Revert back to Dockerfile
2 parents 0d81ff3 + c43f1d6 commit bd5824c

File tree

12 files changed

+868
-1727
lines changed

12 files changed

+868
-1727
lines changed

.gitignore

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -1,89 +0,0 @@
1-
# Byte-compiled / optimized / DLL files
2-
__pycache__/
3-
*.py[cod]
4-
*$py.class
5-
6-
# C extensions
7-
*.so
8-
9-
# Distribution / packaging
10-
.Python
11-
env/
12-
build/
13-
develop-eggs/
14-
dist/
15-
downloads/
16-
eggs/
17-
.eggs/
18-
lib/
19-
lib64/
20-
parts/
21-
sdist/
22-
var/
23-
*.egg-info/
24-
.installed.cfg
25-
*.egg
26-
27-
# PyInstaller
28-
# Usually these files are written by a python script from a template
29-
# before PyInstaller builds the exe, so as to inject date/other infos into it.
30-
*.manifest
31-
*.spec
32-
33-
# Installer logs
34-
pip-log.txt
35-
pip-delete-this-directory.txt
36-
37-
# Unit test / coverage reports
38-
htmlcov/
39-
.tox/
40-
.coverage
41-
.coverage.*
42-
.cache
43-
nosetests.xml
44-
coverage.xml
45-
*,cover
46-
.hypothesis/
47-
48-
# Translations
49-
*.mo
50-
*.pot
51-
52-
# Django stuff:
53-
*.log
54-
local_settings.py
55-
56-
# Flask stuff:
57-
instance/
58-
.webassets-cache
59-
60-
# Scrapy stuff:
61-
.scrapy
62-
63-
# Sphinx documentation
64-
docs/_build/
65-
66-
# PyBuilder
67-
target/
68-
69-
# IPython Notebook
70-
.ipynb_checkpoints
71-
72-
# pyenv
73-
.python-version
74-
75-
# celery beat schedule file
76-
celerybeat-schedule
77-
78-
# dotenv
79-
.env
80-
81-
# virtualenv
82-
venv/
83-
ENV/
84-
85-
# Spyder project settings
86-
.spyderproject
87-
88-
# Rope project settings
89-
.ropeproject

Dockerfile

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Dockerfile for binder
2+
# Reference: https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html
3+
4+
# Pull the Sage docker image
5+
FROM ghcr.io/sagemath/sage/sage-ubuntu-focal-standard-with-targets-optional:dev
6+
7+
USER root
8+
9+
# These lines are here to remove warnings
10+
ENV DEBIAN_FRONTEND noninteractive
11+
ENV DEBCONF_NOWARNINGS="yes"
12+
13+
# Install jupyterlab to the system
14+
RUN apt-get update
15+
RUN apt-get install -y apt-utils
16+
RUN apt-get install -y python3-pip
17+
RUN python3 -m pip install --no-warn-script-location jupyterlab
18+
19+
# Create user "alice" whose uid is 1000
20+
ARG NB_USER=alice
21+
ARG NB_UID=1000
22+
ENV NB_USER ${NB_USER}
23+
ENV NB_UID ${NB_UID}
24+
ENV HOME /home/${NB_USER}
25+
RUN adduser --disabled-password --gecos "Default user" --uid ${NB_UID} ${NB_USER}
26+
27+
# Make sure the contents of our repo are in ${HOME}
28+
COPY notebooks/* ${HOME}/
29+
RUN chown -R ${NB_UID} ${HOME}
30+
31+
# Switch to the user
32+
USER ${NB_USER}
33+
34+
# Install jupyterlab to Sage
35+
RUN /sage/sage -pip install --no-warn-script-location jupyterlab
36+
37+
# Install sagemath kernel to jupyter
38+
RUN mkdir -p $(jupyter --data-dir)/kernels \
39+
&& ln -s /sage/venv/share/jupyter/kernels/sagemath $(jupyter --data-dir)/kernels
40+
41+
# Start in the home directory of the user
42+
WORKDIR /home/${NB_USER}

Dockerfile.disabled

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)