diff --git a/build/sklearn.Dockerfile b/build/sklearn.Dockerfile index a1513eb1c..6dab2e52f 100644 --- a/build/sklearn.Dockerfile +++ b/build/sklearn.Dockerfile @@ -20,14 +20,14 @@ RUN apt update && apt upgrade -y && \ apt install -y --no-install-recommends git wget build-essential ca-certificates && \ apt clean -# Install Python3 and corresponding pip +# Install Python 3 and corresponding pip RUN apt install -y --no-install-recommends python3 python3-distutils && \ wget https://bootstrap.pypa.io/get-pip.py && python3 get-pip.py && \ apt clean && \ ln -sf python3 /usr/bin/python && ln -sf pip3 /usr/bin/pip && \ pip3 install --upgrade pip && \ pip install --no-cache-dir sphinx sphinx-gallery numpydoc matplotlib Pillow pandas \ - scikit-image packaging seaborn pytest && \ + scikit-image packaging seaborn && \ pip install --no-cache-dir scikit-learn==$SKLEARN_VERSION # install latex diff --git a/build/torch.Dockerfile b/build/torch.Dockerfile index 3931c63f0..b073db833 100644 --- a/build/torch.Dockerfile +++ b/build/torch.Dockerfile @@ -1,21 +1,22 @@ FROM ubuntu:20.04 AS pytorch-docs-build -LABEL maintainer="unknownue " +LABEL maintainer="unknownue " LABEL description="An docker environment to build offline PyTorch Docs" LABEL python-version="3.8.x" LABEL license="MIT" ENV DEBIAN_FRONTEND=noninteractive -ARG VERSION_PYTORCH=1.7.0 -ARG VERSION_VISION=0.8.0 +ARG VERSION_PYTORCH=1.8.0 +ARG VERSION_VISION=0.9.0 WORKDIR /root/ # ADD sources.list /etc/apt/sources.list -RUN apt update -RUN apt install -y ca-certificates && \ +RUN apt update && apt install -y ca-certificates +# ADD mirror-ubuntu2004.txt /etc/apt/sources.list +RUN apt update && \ apt install -y --no-install-recommends git wget p7zip-full build-essential && \ apt clean @@ -27,7 +28,7 @@ RUN apt install -y --no-install-recommends python3.8 python3-distutils && \ # python3.8 get-pip.py && \ apt clean && \ ln -sf python3.8 /usr/bin/python && ln -sf pip3 /usr/bin/pip -# RUN pip3 install pqi && pqi use aliyun +RUN pip3 install pqi && pqi use aliyun WORKDIR /root/dev/ @@ -36,8 +37,12 @@ RUN pip3 install setuptools --no-cache-dir && \ wget https://github.com/pytorch/vision/archive/v$VERSION_VISION.zip -O vision.zip && \ wget https://github.com/pytorch/pytorch/archive/v$VERSION_PYTORCH.zip -O torch.zip && \ 7z x vision.zip && 7z x torch.zip && \ - rm vision.zip && rm torch.zip && mv vision-$VERSION_VISION/ vision/ && mv pytorch-$VERSION_PYTORCH/ pytorch/ && \ - pip3 install torch==$VERSION_PYTORCH torchvision==$VERSION_VISION --no-cache-dir + rm vision.zip && rm torch.zip && mv vision-$VERSION_VISION/ vision/ && mv pytorch-$VERSION_PYTORCH/ pytorch/ +RUN wget https://github.com/pytorch/pytorch/raw/master/requirements.txt -P /home/unknownue/deps/ && \ + echo "torch==$VERSION_PYTORCH" >> /home/unknownue/deps/requirements.txt && \ + echo "torchvision==$VERSION_VISION" >> /home/unknownue/deps/requirements.txt && \ + pip install --no-cache-dir --no-deps -r /home/unknownue/deps/requirements.txt +# pip3 install torch==$VERSION_PYTORCH torchvision==$VERSION_VISION --no-cache-dir # install katex globally. See https://github.com/pytorch/pytorch/issues/27705 RUN apt install -y --no-install-recommends nodejs npm @@ -49,3 +54,4 @@ RUN apt autoremove -y && apt clean && \ rm /usr/bin/python && ln -s /usr/bin/python3.8 /usr/bin/python CMD ["bash"] +