-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile_prebuilt
39 lines (33 loc) · 1.33 KB
/
Dockerfile_prebuilt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Dockerfile to build a prebuilt image to run this example on mybinder.org.
FROM node:lts-bullseye
# cache-busting to force rebuild the image in mybinder.org.
RUN echo cache-busting-6
RUN apt-get update &&\
apt-get install -y libzmq3-dev cmake python3-pip &&\
rm -rf /var/lib/apt/lists/* &&\
pip3 install --no-cache-dir -U jupyterlab
# Support UTF-8 filename in Python (https://stackoverflow.com/a/31754469)
ENV LC_CTYPE=C.UTF-8
# Check the uid of node is 1000 to follow the convention of mybinder to use this image from mybinder.org.
# https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html#preparing-your-dockerfile
# Notes:
# Don't use ARG NB_USER here. It's overwritten with jovyan.
ENV HOME /home/node
RUN id -u node | grep -c "^1000$"
USER node
WORKDIR ${HOME}
# Install tslab
ENV PATH $PATH:${HOME}/.npm-global/bin
RUN mkdir ~/.npm-global &&\
npm config set prefix '~/.npm-global' &&\
npm install -g tslab &&\
tslab install
RUN git clone --depth 1 https://github.com/yunabe/tslab-examples.git
WORKDIR ${HOME}/tslab-examples
# TODO(yunabe): Use npm instead of yarn v1.
RUN yarn
# Notes:
# 1. Do not use ENTRYPOINT because mybinder need to run a custom command.
# 2. To use JupyterNotebook, replace "lab" with notebook".
# 3. Set --allow-root in case you want to run jupyter as root.
CMD ["jupyter", "lab", "--ip=0.0.0.0"]