|
| 1 | +FROM ubuntu:18.04 as base |
| 2 | + |
| 3 | +ENV DEBIAN_FRONTEND=noninteractive |
| 4 | + |
| 5 | +RUN apt-get clean && apt-get update |
| 6 | +RUN apt-get install -y curl locales git-all autoconf automake make cmake wget unzip vim gcc g++ |
| 7 | + |
| 8 | +RUN locale-gen en_US.UTF-8 |
| 9 | + |
| 10 | +ENV LC_ALL en_US.UTF-8 |
| 11 | +ENV LANG en_US.UTF-8 |
| 12 | +ENV LANGUAGE en_US.UTF-8 |
| 13 | + |
| 14 | +# Install openssl |
| 15 | +FROM base as openssl |
| 16 | +ADD ./common/install_openssl.sh install_openssl.sh |
| 17 | +RUN bash ./install_openssl.sh && rm install_openssl.sh |
| 18 | + |
| 19 | +# Install python |
| 20 | +FROM base as python |
| 21 | +ADD common/install_cpython.sh install_cpython.sh |
| 22 | +RUN apt-get update -y && \ |
| 23 | + apt-get install build-essential gdb lcov libbz2-dev libffi-dev \ |
| 24 | + libgdbm-dev liblzma-dev libncurses5-dev libreadline6-dev \ |
| 25 | + libsqlite3-dev libssl-dev lzma lzma-dev tk-dev uuid-dev zlib1g-dev -y && \ |
| 26 | + bash ./install_cpython.sh && \ |
| 27 | + rm install_cpython.sh && \ |
| 28 | + apt-get clean |
| 29 | + |
| 30 | +FROM base as intel |
| 31 | +# Install MKL |
| 32 | +ADD ./common/install_mkl.sh install_mkl.sh |
| 33 | +RUN bash ./install_mkl.sh && rm install_mkl.sh |
| 34 | + |
| 35 | +FROM base as conda |
| 36 | +ADD ./common/install_conda.sh install_conda.sh |
| 37 | +RUN bash ./install_conda.sh && rm install_conda.sh |
| 38 | +RUN /opt/conda/bin/conda install -y cmake=3.14 |
| 39 | + |
| 40 | +FROM base as final |
| 41 | +# Install LLVM |
| 42 | +COPY --from=pytorch/llvm:9.0.1 /opt/llvm /opt/llvm |
| 43 | +COPY --from=pytorch/llvm:9.0.1 /opt/llvm_no_cxx11_abi /opt/llvm_no_cxx11_abi |
| 44 | +COPY --from=openssl /opt/openssl /opt/openssl |
| 45 | +# Install patchelf |
| 46 | +ADD ./common/install_patchelf.sh install_patchelf.sh |
| 47 | +RUN bash ./install_patchelf.sh && rm install_patchelf.sh |
| 48 | +COPY --from=intel /opt/intel /opt/intel |
| 49 | +# Install Anaconda |
| 50 | +COPY --from=conda /opt/conda /opt/conda |
| 51 | +# Install python |
| 52 | +COPY --from=python /opt/python /opt/python |
| 53 | +COPY --from=python /opt/_internal /opt/_internal |
| 54 | +ENV PATH /opt/conda/bin:$PATH |
0 commit comments