-
Notifications
You must be signed in to change notification settings - Fork 75
/
Dockerfile
34 lines (27 loc) · 1.27 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
32
33
34
From python:3.8.13-buster
ARG PIP_PKGS="ylearn lightgbm igraph jupyterlab gcastle pgmpy ipywidgets tqdm ipywidgets matplotlib shap"
ARG PIP_OPTS="--disable-pip-version-check --no-cache-dir"
#ARG PIP_OPTS="--disable-pip-version-check --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple/"
# COPY sources.list /etc/apt/sources.list
RUN apt update \
&& apt install -y graphviz \
&& apt clean \
&& pip install $PIP_OPTS $PIP_PKGS \
&& v=$(pip show ylearn|awk '/Version/{print($2)}') \
&& echo ylearn version:$v \
&& pip download --no-deps --no-binary ylearn --dest /tmp/ $PIP_OPTS ylearn==$v \
&& tar xzf /tmp/ylearn-$v.tar.gz -C /tmp/ \
&& mkdir -p /opt/datacanvas \
&& cp -r /tmp/ylearn-$v/example_usages /opt/datacanvas/ \
&& echo "#!/bin/bash\njupyter lab --notebook-dir=/opt/datacanvas --ip=0.0.0.0 --port=\$NotebookPort --no-browser --allow-root --NotebookApp.token=\$NotebookToken" > /entrypoint.sh \
&& chmod +x /entrypoint.sh \
&& rm -rf /var/lib/apt/lists \
&& rm -rf /var/cache/* \
&& rm -rf /var/log/* \
&& rm -rf /root/.cache \
&& rm -rf /tmp/*
EXPOSE 8888
ENV NotebookToken="" \
NotebookPort=8888
CMD ["/entrypoint.sh"]
# docker run --rm --name ylearn -p 8888:8888 -e NotebookToken=your-token datacanvas/ylearn