jittor/Dockerfile

50 lines
1.5 KiB
Docker
Raw Normal View History

2020-05-14 19:37:48 +08:00
# docker build commands
ARG FROM_IMAGE=ubuntu:18.04
FROM ${FROM_IMAGE}
2020-05-14 11:12:58 +08:00
RUN apt update && apt install ca-certificates -y
# change tsinghua mirror
RUN echo \
2020-05-14 19:37:48 +08:00
"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
2020-05-14 11:12:58 +08:00
RUN apt update && apt install wget \
2020-05-14 19:37:48 +08:00
python3.7 python3.7-dev \
2021-04-15 14:33:51 +08:00
g++ build-essential openssh-server -y
2020-05-14 11:12:58 +08:00
2020-05-14 19:37:48 +08:00
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
2020-05-14 11:12:58 +08:00
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 \
2020-05-14 19:37:48 +08:00
astunparse \
notebook
2020-05-14 11:12:58 +08:00
2020-05-16 16:42:22 +08:00
RUN pip3 install matplotlib
2020-05-17 23:55:18 +08:00
RUN apt install openmpi-bin openmpi-common libopenmpi-dev -y
2020-06-30 16:44:14 +08:00
RUN pip3 install jittor --timeout 100 && python3.7 -m jittor.test.test_example
RUN pip3 uninstall jittor -y
2020-05-14 11:12:58 +08:00
COPY . .
RUN pip3 install . --timeout 100
2020-05-14 19:37:48 +08:00
RUN python3.7 -m jittor.test.test_example
2020-05-15 20:37:56 +08:00
CMD python3.7 -m jittor.notebook --allow-root --ip=0.0.0.0