Build pytorch dockerfile failed

username: Farrell
cooked: <p>My dockerfile is from <a href="https://github.com/pytorch/pytorch/commit/4dbeb87e52982c2e1aecf901e6742fb9eb64c9c7#diff-305c1a8c354e4056b2827374b606efd0" rel="nofollow noopener">https://github.com/pytorch/pytorch/commit/4dbeb87e52982c2e1aecf901e6742fb9eb64c9c7#diff-305c1a8c354e4056b2827374b606efd0</a> <a href="https://github.com/pytorch/pytorch/blob/master/docker/pytorch/Dockerfile" rel="nofollow noopener">https://github.com/pytorch/pytorch/blob/master/docker/pytorch/Dockerfile</a></p>
<p>I changed cuda version 10.0 to 9.0<br>
here is my Dockerfile:</p>
<pre><code class="lang-auto">FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
ARG PYTHON_VERSION=3.6
RUN apt-get update &amp;&amp; apt-get install -y --no-install-recommends \
         build-essential \
         cmake \
         git \
         curl \
         ca-certificates \
         libjpeg-dev \
         libpng-dev &amp;&amp; \
     rm -rf /var/lib/apt/lists/*


RUN curl -o ~/miniconda.sh -O  https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh  &amp;&amp; \
     chmod +x ~/miniconda.sh &amp;&amp; \
     ~/miniconda.sh -b -p /opt/conda &amp;&amp; \
     rm ~/miniconda.sh &amp;&amp; \
     /opt/conda/bin/conda install -y python=$PYTHON_VERSION numpy pyyaml scipy ipython mkl mkl-include ninja cython typing &amp;&amp; \
     /opt/conda/bin/conda install -y -c pytorch magma-cuda100 &amp;&amp; \
     /opt/conda/bin/conda clean -ya
ENV PATH /opt/conda/bin:$PATH
# This must be done before pip so that requirements.txt is available
WORKDIR /opt/pytorch
COPY . .

RUN git submodule update --init --recursive
RUN TORCH_CUDA_ARCH_LIST="3.5 5.2 6.0 6.1 7.0+PTX" TORCH_NVCC_FLAGS="-Xfatbin -compress-all" \
    CMAKE_PREFIX_PATH="$(dirname $(which conda))/../" \
    pip install -v .

RUN git clone https://github.com/pytorch/vision.git &amp;&amp; cd vision &amp;&amp; pip install -v .

WORKDIR /workspace
RUN chmod -R a+w .
</code></pre>
<p>I executed docker build, and I got this:</p>
<pre><code class="lang-auto">Sending build context to Docker daemon  3.072kB
Step 1/13 : FROM nvidia/cuda:9.0-cudnn7-devel-ubuntu16.04
 ---&gt; afc5ab1e9a0d
Step 2/13 : ARG PYTHON_VERSION=3.6
 ---&gt; Using cache
 ---&gt; 956aaeb0f1b7
Step 3/13 : RUN apt-get update &amp;&amp; apt-get install -y --no-install-recommends          build-essential          cmake          git          curl          ca-certificates          libjpeg-dev          libpng-dev &amp;&amp;      rm -rf /var/lib/apt/lists/*
 ---&gt; Using cache
 ---&gt; e18e7fec7691
Step 4/13 : RUN curl -o ~/miniconda.sh -O  https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh  &amp;&amp;      chmod +x ~/miniconda.sh &amp;&amp;      ~/miniconda.sh -b -p /opt/conda &amp;&amp;      rm ~/miniconda.sh &amp;&amp;      /opt/conda/bin/conda install -y python=$PYTHON_VERSION numpy pyyaml scipy ipython mkl mkl-include ninja cython typing &amp;&amp;      /opt/conda/bin/conda install -y -c pytorch magma-cuda100 &amp;&amp;      /opt/conda/bin/conda clean -ya
 ---&gt; Using cache
 ---&gt; 121b8d486e0b
Step 5/13 : ENV PATH /opt/conda/bin:$PATH
 ---&gt; Using cache
 ---&gt; 4f8332eed85b
Step 6/13 : WORKDIR /opt/pytorch
 ---&gt; Using cache
 ---&gt; 249592e692ad
Step 7/13 : COPY . .
 ---&gt; a248c8bc4865
Step 8/13 : RUN ls
 ---&gt; Running in 9dc1ca1e2c9f
Dockerfile
Removing intermediate container 9dc1ca1e2c9f
 ---&gt; 0600255e2c98
Step 9/13 : RUN git submodule update --init --recursive
 ---&gt; Running in 8c683be2721a
fatal: Not a git repository (or any of the parent directories): .git
</code></pre>

username: ptrblck
cooked: <p>Make sure your current working directory is inside the <code>pytorch</code> folder.<br>
Also, you might want to change the <code>magma-cuda100</code> version to <code>magma-cuda90</code>.</p>