2017-06-30 11:46:45 +02:00
|
|
|
#===- llvm/utils/docker/debian8/build/Dockerfile -------------------------===//
|
|
|
|
#
|
2019-01-19 09:50:56 +01:00
|
|
|
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
# See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2017-06-30 11:46:45 +02:00
|
|
|
#
|
|
|
|
#===----------------------------------------------------------------------===//
|
2018-03-26 17:12:30 +02:00
|
|
|
# Stage 1. Check out LLVM source code and run the build.
|
|
|
|
FROM launcher.gcr.io/google/debian8:latest as builder
|
2017-06-30 11:46:45 +02:00
|
|
|
LABEL maintainer "LLVM Developers"
|
|
|
|
# Install build dependencies of llvm.
|
|
|
|
# First, Update the apt's source list and include the sources of the packages.
|
|
|
|
RUN grep deb /etc/apt/sources.list | \
|
|
|
|
sed 's/^deb/deb-src /g' >> /etc/apt/sources.list
|
|
|
|
# Install compiler, python and subversion.
|
|
|
|
RUN apt-get update && \
|
2017-08-18 11:37:23 +02:00
|
|
|
apt-get install -y --no-install-recommends ca-certificates gnupg \
|
2018-01-22 18:19:41 +01:00
|
|
|
build-essential python wget subversion unzip && \
|
2017-06-30 11:46:45 +02:00
|
|
|
rm -rf /var/lib/apt/lists/*
|
2018-01-22 18:19:41 +01:00
|
|
|
# Install a newer ninja release. It seems the older version in the debian repos
|
|
|
|
# randomly crashes when compiling llvm.
|
|
|
|
RUN wget "https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip" && \
|
|
|
|
echo "d2fea9ff33b3ef353161ed906f260d565ca55b8ca0568fa07b1d2cab90a84a07 ninja-linux.zip" \
|
|
|
|
| sha256sum -c && \
|
|
|
|
unzip ninja-linux.zip -d /usr/local/bin && \
|
|
|
|
rm ninja-linux.zip
|
2017-08-18 11:37:23 +02:00
|
|
|
# Import public key required for verifying signature of cmake download.
|
|
|
|
RUN gpg --keyserver hkp://pgp.mit.edu --recv 0x2D2CEF1034921684
|
|
|
|
# Download, verify and install cmake version that can compile clang into /usr/local.
|
2017-06-30 11:46:45 +02:00
|
|
|
# (Version in debian8 repos is is too old)
|
2017-08-18 11:37:23 +02:00
|
|
|
RUN mkdir /tmp/cmake-install && cd /tmp/cmake-install && \
|
|
|
|
wget "https://cmake.org/files/v3.7/cmake-3.7.2-SHA-256.txt.asc" && \
|
|
|
|
wget "https://cmake.org/files/v3.7/cmake-3.7.2-SHA-256.txt" && \
|
|
|
|
gpg --verify cmake-3.7.2-SHA-256.txt.asc cmake-3.7.2-SHA-256.txt && \
|
|
|
|
wget "https://cmake.org/files/v3.7/cmake-3.7.2-Linux-x86_64.tar.gz" && \
|
|
|
|
( grep "cmake-3.7.2-Linux-x86_64.tar.gz" cmake-3.7.2-SHA-256.txt | \
|
|
|
|
sha256sum -c - ) && \
|
|
|
|
tar xzf cmake-3.7.2-Linux-x86_64.tar.gz -C /usr/local --strip-components=1 && \
|
|
|
|
cd / && rm -rf /tmp/cmake-install
|
2017-06-30 11:46:45 +02:00
|
|
|
|
2017-09-15 15:35:54 +02:00
|
|
|
ADD checksums /tmp/checksums
|
|
|
|
ADD scripts /tmp/scripts
|
2018-04-20 12:19:38 +02:00
|
|
|
|
|
|
|
# Checkout the source code.
|
|
|
|
ARG checkout_args
|
|
|
|
RUN /tmp/scripts/checkout.sh ${checkout_args}
|
2018-03-26 17:12:30 +02:00
|
|
|
# Run the build. Results of the build will be available at /tmp/clang-install/.
|
2018-04-20 12:19:38 +02:00
|
|
|
ARG buildscript_args
|
|
|
|
RUN /tmp/scripts/build_install_llvm.sh --to /tmp/clang-install ${buildscript_args}
|
2018-03-26 17:12:30 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Stage 2. Produce a minimal release image with build results.
|
|
|
|
FROM launcher.gcr.io/google/debian8:latest
|
|
|
|
LABEL maintainer "LLVM Developers"
|
|
|
|
# Install packages for minimal useful image.
|
|
|
|
RUN apt-get update && \
|
|
|
|
apt-get install -y --no-install-recommends libstdc++-4.9-dev binutils && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy build results of stage 1 to /usr/local.
|
|
|
|
COPY --from=builder /tmp/clang-install/ /usr/local/
|