update docker base on PT 1.7 (#6931)

* update docker base on PT 1.7

* fix path
This commit is contained in:
Jirka Borovec 2021-04-13 11:06:06 +02:00 committed by GitHub
parent 6c01608456
commit da1ac3a530
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 41 deletions

View File

@ -12,52 +12,17 @@
# See the License for the specific language governing permissions and
# limitations under the License.
FROM nvcr.io/nvidia/cuda:11.1.1-runtime-ubuntu20.04
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes/rel_21-03.html#rel_21-03
FROM nvcr.io/nvidia/pytorch:20.12-py3
MAINTAINER PyTorchLightning <https://github.com/PyTorchLightning>
ARG LIGHTNING_VERSION=""
SHELL ["/bin/bash", "-c"]
# https://techoverflow.net/2019/05/18/how-to-fix-configuring-tzdata-interactive-input-when-building-docker-images/
ENV \
DEBIAN_FRONTEND=noninteractive \
TZ=Europe/Prague \
PATH="$PATH:/root/.local/bin" \
CUDA_TOOLKIT_ROOT_DIR="/usr/local/cuda" \
MKL_THREADING_LAYER=GNU
RUN apt-get update -qq && \
apt-get install -y --no-install-recommends \
build-essential \
python3 \
python3-distutils \
python3-dev \
pkg-config \
cmake \
git \
wget \
unzip \
ca-certificates \
&& \
# Cleaning
apt-get autoremove -y && \
apt-get clean && \
rm -rf /root/.cache && \
rm -rf /var/lib/apt/lists/* && \
# Setup PIP
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \
wget https://bootstrap.pypa.io/get-pip.py --progress=bar:force:noscroll --no-check-certificate && \
python get-pip.py && \
rm get-pip.py && \
pip --version
COPY ./ /home/pytorch-lightning/
COPY ./ /workspace/pytorch-lightning/
RUN \
cd /home && \
cd /workspace && \
mv pytorch-lightning/notebooks . && \
mv pytorch-lightning/pl_examples . && \
# replace by specific version if asked
@ -71,9 +36,10 @@ RUN \
# Installations
python -c "fname = './pytorch-lightning/requirements/extra.txt' ; lines = [line for line in open(fname).readlines() if not line.startswith('horovod')] ; open(fname, 'w').writelines(lines)" && \
pip install -r ./pytorch-lightning/requirements/extra.txt -U --no-cache-dir && \
pip install -r ./pytorch-lightning/requirements/examples.txt -U --no-cache-dir && \
pip install -r ./pytorch-lightning/requirements/extra.txt --no-cache-dir --upgrade-strategy only-if-needed && \
pip install -r ./pytorch-lightning/requirements/examples.txt --no-cache-dir --upgrade-strategy only-if-needed && \
pip install ./pytorch-lightning --no-cache-dir && \
pip install "Pillow>=8.1" "torchtext>=0.9.0" ipython[all] --no-cache-dir --upgrade-strategy only-if-needed && \
rm -rf pytorch-lightning
RUN python --version && \

View File

@ -1,2 +1,3 @@
torchvision>=0.5
gym>=0.17.0
ipython[all]