Skip to content

Commit

Permalink
🐳 Update pytorch version in Dockerfile.
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownue committed Mar 10, 2021
1 parent 8ce388c commit 6ce829d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions build/sklearn.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 14 additions & 8 deletions build/torch.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@

FROM ubuntu:20.04 AS pytorch-docs-build

LABEL maintainer="unknownue <usami-ssc@protonmail.com>"
LABEL maintainer="unknownue <unknownue@outlook.com>"
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

Expand All @@ -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/

Expand All @@ -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
Expand All @@ -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"]

0 comments on commit 6ce829d

Please sign in to comment.