-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
31 lines (26 loc) · 1.04 KB
/
Dockerfile
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
FROM condaforge/mambaforge:latest
ARG NB_USER="tintx"
ARG NB_UID="1000"
ENV USER=${NB_USER} \
HOME=/tmp/${NB_USER} \
NB_GID=${NB_UID} \
NB_GROUP=${NB_USER} \
DATA_FILES=/tmp/$NB_USER/.data
COPY . /tmp/tint_clone
RUN set -e && \
groupadd -r --gid "$NB_GID" "$NB_GROUP" && \
adduser --uid "$NB_UID" --gid "$NB_GID" --gecos "Default user" \
--shell /bin/bash --disabled-password "$NB_USER" --home $HOME && \
mamba install -y tintx ipykernel jupyterlab notebook bash_kernel ffmpeg &&\
cp -r /tmp/tint_clone/docs/source/_static/data $HOME/.data &&\
for i in $(ls /tmp/tint_clone/docs/source/*.ipynb);do sed -i "s/\.html/\.ipynb/g" $i ;done &&\
cp /tmp/tint_clone/docs/source/*.ipynb $HOME/ &&\
cp /tmp/tint_clone/.Readme.ipynb $HOME/Readme.ipynb &&\
rm -fr /tmp/tint_clone &&\
chown -R $NB_USER:$NB_GROUP $HOME
USER $NB_USER
WORKDIR $HOME
RUN set -e &&\
mamba run python3 -m bash_kernel.install &&\
mamba run python3 -m ipykernel install --name tintx --user \
--env DATA_FILES $DATA_FILES --display-name "tintX kernel"