Home | History | Annotate | Download | only in debian9
      1 #===- libcxx/utils/docker/debian9/Dockerfile -------------------------===//
      2 #
      3 #                     The LLVM Compiler Infrastructure
      4 #
      5 # This file is distributed under the University of Illinois Open Source
      6 # License. See LICENSE.TXT for details.
      7 #
      8 #===----------------------------------------------------------------------===//
      9 
     10 # Setup the base builder image with the packages we'll need to build GCC and Clang from source.
     11 FROM launcher.gcr.io/google/debian9:latest as builder-base
     12 LABEL maintainer "libc++ Developers"
     13 
     14 RUN apt-get update && \
     15     apt-get install -y --no-install-recommends \
     16       ca-certificates \
     17       gnupg \
     18       build-essential \
     19       wget \
     20       subversion \
     21       unzip \
     22       automake \
     23       python \
     24       cmake \
     25       ninja-build \
     26       curl \
     27       git \
     28       gcc-multilib \
     29       g++-multilib \
     30       libc6-dev \
     31       bison \
     32       flex \
     33       libtool \
     34       autoconf \
     35       binutils-dev \
     36       binutils-gold \
     37       software-properties-common && \
     38   update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.gold" 20 && \
     39   update-alternatives --install "/usr/bin/ld" "ld" "/usr/bin/ld.bfd" 10
     40 
     41 # Build GCC 4.9 for testing our C++11 against
     42 FROM builder-base as gcc-49-builder
     43 LABEL maintainer "libc++ Developers"
     44 
     45 ADD scripts/build_gcc.sh /tmp/build_gcc.sh
     46 
     47 RUN git clone --depth=1 --branch gcc-4_9_4-release git://gcc.gnu.org/git/gcc.git /tmp/gcc-4.9.4
     48 RUN cd /tmp/gcc-4.9.4/ && ./contrib/download_prerequisites
     49 RUN /tmp/build_gcc.sh --source /tmp/gcc-4.9.4 --to /opt/gcc-4.9.4
     50 
     51 # Build GCC ToT for testing in all dialects.
     52 FROM builder-base as gcc-tot-builder
     53 LABEL maintainer "libc++ Developers"
     54 
     55 ADD scripts/build_gcc.sh /tmp/build_gcc.sh
     56 
     57 RUN git clone --depth=1 git://gcc.gnu.org/git/gcc.git /tmp/gcc-tot
     58 RUN cd /tmp/gcc-tot && ./contrib/download_prerequisites
     59 RUN /tmp/build_gcc.sh --source /tmp/gcc-tot --to /opt/gcc-tot
     60 
     61 # Build LLVM 4.0 which is used to test against a "legacy" compiler.
     62 FROM builder-base as llvm-4-builder
     63 LABEL maintainer "libc++ Developers"
     64 
     65 ADD scripts/checkout_git.sh /tmp/checkout_git.sh
     66 ADD scripts/build_install_llvm.sh /tmp/build_install_llvm.sh
     67 
     68 RUN /tmp/checkout_git.sh --to /tmp/llvm-4.0 -p clang -p compiler-rt --branch release_40
     69 RUN /tmp/build_install_llvm.sh \
     70     --install /opt/llvm-4.0 \
     71     --source /tmp/llvm-4.0 \
     72     --build /tmp/build-llvm-4.0 \
     73     -i install-clang -i install-clang-headers \
     74     -i install-compiler-rt \
     75     -- \
     76     -DCMAKE_BUILD_TYPE=RELEASE \
     77     -DLLVM_ENABLE_ASSERTIONS=ON
     78 
     79 # Stage 2. Produce a minimal release image with build results.
     80 FROM launcher.gcr.io/google/debian9:latest
     81 LABEL maintainer "libc++ Developers"
     82 
     83 # Copy over the GCC and Clang installations
     84 COPY --from=gcc-49-builder /opt/gcc-4.9.4 /opt/gcc-4.9.4
     85 COPY --from=gcc-tot-builder /opt/gcc-tot /opt/gcc-tot
     86 COPY --from=llvm-4-builder /opt/llvm-4.0 /opt/llvm-4.0
     87 
     88 RUN ln -s /opt/gcc-4.9.4/bin/gcc /usr/local/bin/gcc-4.9 && \
     89     ln -s /opt/gcc-4.9.4/bin/g++ /usr/local/bin/g++-4.9
     90 
     91 RUN apt-get update && \
     92     apt-get install -y \
     93       ca-certificates \
     94       gnupg \
     95       build-essential \
     96       apt-transport-https \
     97       curl \
     98       software-properties-common
     99 
    100 RUN apt-get install -y --no-install-recommends \
    101     systemd \
    102     sysvinit-utils \
    103     cmake \
    104     subversion \
    105     git \
    106     ninja-build \
    107     gcc-multilib \
    108     g++-multilib \
    109     python \
    110     buildbot-slave
    111 
    112 ADD scripts/install_clang_packages.sh /tmp/install_clang_packages.sh
    113 RUN /tmp/install_clang_packages.sh && rm /tmp/install_clang_packages.sh
    114 
    115 RUN git clone https://git.llvm.org/git/libcxx.git /libcxx
    116