forked from Jittor/jittor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (33 loc) · 1.48 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# docker build commands
ARG FROM_IMAGE=ubuntu:18.04
FROM ${FROM_IMAGE}
RUN apt update && apt install ca-certificates -y
# change tsinghua mirror
RUN echo \
"deb [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse\n\
deb [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse\n\
deb [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse\n\
deb [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse" > /etc/apt/sources.list
RUN apt update && apt install wget \
python3.7 python3.7-dev \
g++ build-essential openssh-server -y
WORKDIR /usr/src/jittor
RUN apt download python3-distutils && dpkg-deb -x ./python3-distutils* / \
&& wget -O - https://bootstrap.pypa.io/get-pip.py | python3.7
ENV PYTHONIOENCODING utf8
# change tsinghua mirror
RUN pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip3 install \
numpy \
tqdm \
pillow \
astunparse \
notebook
RUN pip3 install matplotlib
RUN apt install openmpi-bin openmpi-common libopenmpi-dev -y
RUN pip3 install jittor --timeout 100 && python3.7 -m jittor.test.test_example
RUN pip3 uninstall jittor -y
COPY . .
RUN pip3 install . --timeout 100
RUN python3.7 -m jittor.test.test_example
CMD python3.7 -m jittor.notebook --allow-root --ip=0.0.0.0