mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 04:44:13 +08:00
In Dockerfile, do not install unecessary packages, use conda to install ninja (saving one layer), and use "." to refer to WORKDIR to reduce redundancy. (#20881)
Summary: - Do not install unecessary packages in the Docker image. - In the Docker image, use conda to install ninja (saving one layer) - When workdir is set, use "." to refer to it to reduce redundancy. Pull Request resolved: https://github.com/pytorch/pytorch/pull/20881 Differential Revision: D15495769 Pulled By: ezyang fbshipit-source-id: dab7df71ac107c85fb1447697e25978daffc7e0b
This commit is contained in:
committed by
Facebook Github Bot
parent
6af2482612
commit
4109ec1278
@ -5,10 +5,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
cmake \
|
||||
git \
|
||||
curl \
|
||||
vim \
|
||||
ca-certificates \
|
||||
libjpeg-dev \
|
||||
libpng-dev &&\
|
||||
libpng-dev && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
@ -16,11 +15,10 @@ RUN curl -o ~/miniconda.sh -O https://repo.continuum.io/miniconda/Miniconda3-la
|
||||
chmod +x ~/miniconda.sh && \
|
||||
~/miniconda.sh -b -p /opt/conda && \
|
||||
rm ~/miniconda.sh && \
|
||||
/opt/conda/bin/conda install -y python=$PYTHON_VERSION numpy pyyaml scipy ipython mkl mkl-include cython typing && \
|
||||
/opt/conda/bin/conda install -y python=$PYTHON_VERSION numpy pyyaml scipy ipython mkl mkl-include ninja cython typing && \
|
||||
/opt/conda/bin/conda install -y -c pytorch magma-cuda100 && \
|
||||
/opt/conda/bin/conda clean -ya
|
||||
ENV PATH /opt/conda/bin:$PATH
|
||||
RUN pip install ninja
|
||||
# This must be done before pip so that requirements.txt is available
|
||||
WORKDIR /opt/pytorch
|
||||
COPY . .
|
||||
@ -33,4 +31,4 @@ RUN TORCH_CUDA_ARCH_LIST="3.5 5.2 6.0 6.1 7.0+PTX" TORCH_NVCC_FLAGS="-Xfatbin -c
|
||||
RUN git clone https://github.com/pytorch/vision.git && cd vision && pip install -v .
|
||||
|
||||
WORKDIR /workspace
|
||||
RUN chmod -R a+w /workspace
|
||||
RUN chmod -R a+w .
|
||||
|
Reference in New Issue
Block a user