add dockerfile

This commit is contained in:
Dun Liang 2020-05-14 11:12:58 +08:00
parent be141b067c
commit 60b182b8cc
2 changed files with 37 additions and 2 deletions

35
Dockerfile Normal file
View File

@ -0,0 +1,35 @@
FROM ubuntu:20.04
RUN apt update && apt install ca-certificates -y
# change tsinghua mirror
RUN echo \
"deb [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse\n\
deb [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse\n\
deb [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse\n\
deb [trusted=yes] https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse" > /etc/apt/sources.list
RUN apt update && apt install wget \
python3 python3-dev python3-pip \
g++ build-essential -y
ENV PYTHONIOENCODING utf8
# change tsinghua mirror
RUN pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
RUN pip3 install \
pybind11 \
numpy \
tqdm \
pillow \
astunparse
WORKDIR /usr/src/jittor
COPY . .
RUN pip3 install . --timeout 100
RUN python3 -m jittor.test.test_example
RUN rm -rf ~/.cache/jittor/default

View File

@ -1,7 +1,7 @@
error_msg = "Jittor only supports Ubuntu>=16.04 currently."
try:
with open("/etc/os-release") as f:
with open("/etc/os-release", "r", encoding='utf8') as f:
s = f.read().splitlines()
m = {}
for line in s:
@ -16,7 +16,7 @@ from setuptools import setup, find_packages
import os
path = os.path.dirname(__file__)
with open(os.path.join(path, "README.src.md")) as fh:
with open(os.path.join(path, "README.src.md"), "r", encoding='utf8') as fh:
long_description = fh.read()
setuptools.setup(