|
| 1 | +FROM centos:8 as base |
| 2 | + |
| 3 | +ENV LC_ALL en_US.UTF-8 |
| 4 | +ENV LANG en_US.UTF-8 |
| 5 | +ENV LANGUAGE en_US.UTF-8 |
| 6 | + |
| 7 | +# change to a valid repo |
| 8 | +RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-Linux-*.repo |
| 9 | +# enable to install ninja-build |
| 10 | +RUN sed -i 's|enabled=0|enabled=1|g' /etc/yum.repos.d/CentOS-Linux-PowerTools.repo |
| 11 | + |
| 12 | +RUN yum -y update |
| 13 | +RUN yum install -y wget curl perl util-linux xz bzip2 git patch which unzip |
| 14 | +RUN yum install -y autoconf automake make cmake gdb gcc gcc-c++ |
| 15 | + |
| 16 | +FROM base as patchelf |
| 17 | +# Install patchelf |
| 18 | +ADD ./common/install_patchelf.sh install_patchelf.sh |
| 19 | +RUN bash ./install_patchelf.sh && rm install_patchelf.sh && cp $(which patchelf) /patchelf |
| 20 | + |
| 21 | +FROM base as openssl |
| 22 | +# Install openssl |
| 23 | +ADD ./common/install_openssl.sh install_openssl.sh |
| 24 | +RUN bash ./install_openssl.sh && rm install_openssl.sh |
| 25 | + |
| 26 | +FROM base as conda |
| 27 | +# Install Anaconda |
| 28 | +ADD ./common/install_conda.sh install_conda.sh |
| 29 | +RUN bash ./install_conda.sh && rm install_conda.sh |
| 30 | + |
| 31 | +# Install MNIST test data |
| 32 | +FROM base as mnist |
| 33 | +ADD ./common/install_mnist.sh install_mnist.sh |
| 34 | +RUN bash ./install_mnist.sh |
| 35 | + |
| 36 | +FROM base as final |
| 37 | +# Install LLVM |
| 38 | +COPY --from=pytorch/llvm:9.0.1 /opt/llvm /opt/llvm |
| 39 | +COPY --from=pytorch/llvm:9.0.1 /opt/llvm_no_cxx11_abi /opt/llvm_no_cxx11_abi |
| 40 | +COPY --from=openssl /opt/openssl /opt/openssl |
| 41 | +COPY --from=patchelf /patchelf /usr/local/bin/patchelf |
| 42 | +COPY --from=conda /opt/conda /opt/conda |
| 43 | +ADD ./java/jni.h /usr/local/include/jni.h |
| 44 | +ENV PATH /opt/conda/bin:$PATH |
| 45 | +COPY --from=mnist /usr/local/mnist /usr/local/mnist |
| 46 | +RUN rm -rf /usr/local/cuda |
| 47 | +RUN chmod o+rw /usr/local |
| 48 | +RUN touch /.condarc && \ |
| 49 | + chmod o+rw /.condarc && \ |
| 50 | + chmod -R o+rw /opt/conda |
0 commit comments