1 #===- llvm/utils/docker/debian10/build/Dockerfile -------------------------===//
3 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 # See https://llvm.org/LICENSE.txt for license information.
5 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 #===----------------------------------------------------------------------===//
8 # Stage 1. Check out LLVM source code and run the build.
9 FROM launcher.gcr.io/google/debian10:latest as builder
10 LABEL maintainer "LLVM Developers"
11 # Install build dependencies of llvm.
12 # First, Update the apt's source list and include the sources of the packages.
13 RUN grep deb /etc/apt/sources.list | \
14 sed 's/^deb/deb-src /g' >> /etc/apt/sources.list
15 # Install compiler, python and subversion.
16 RUN apt-get update && \
17 apt-get install -y --no-install-recommends ca-certificates gnupg \
18 build-essential cmake make python3 zlib1g wget subversion unzip git && \
19 rm -rf /var/lib/apt/lists/*
20 # Install a newer ninja release. It seems the older version in the debian repos
21 # randomly crashes when compiling llvm.
22 RUN wget "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip" && \
23 echo "d2fea9ff33b3ef353161ed906f260d565ca55b8ca0568fa07b1d2cab90a84a07 ninja-linux.zip" \
25 unzip ninja-linux.zip -d /usr/local/bin && \
28 ADD checksums /tmp/checksums
29 ADD scripts /tmp/scripts
31 # Checkout the source code.
33 RUN /tmp/scripts/checkout.sh ${checkout_args}
34 # Run the build. Results of the build will be available at /tmp/clang-install/.
36 RUN /tmp/scripts/build_install_llvm.sh --to /tmp/clang-install ${buildscript_args}
39 # Stage 2. Produce a minimal release image with build results.
40 FROM launcher.gcr.io/google/debian10:latest
41 LABEL maintainer "LLVM Developers"
42 # Install packages for minimal useful image.
43 RUN apt-get update && \
44 apt-get install -y --no-install-recommends libstdc++-7-dev binutils && \
45 rm -rf /var/lib/apt/lists/*
46 # Copy build results of stage 1 to /usr/local.
47 COPY --from=builder /tmp/clang-install/ /usr/local/