blob: d875ed96d9070f17dd628a4e6cfaad2e42521adb [file] [log] [blame]
Ilya Biryukovd9502012018-03-26 15:12:30 +00001#===- llvm/utils/docker/example/build/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# This is an example Dockerfile to build an image that compiles clang.
10# Replace FIXMEs to prepare your own image.
11
12# Stage 1. Check out LLVM source code and run the build.
13# FIXME: Replace 'ubuntu' with your base image
14FROM ubuntu as builder
15# FIXME: Change maintainer name
16LABEL maintainer "Maintainer <maintainer@email>"
17# FIXME: Install llvm/clang build dependencies here. Including compiler to
18# build stage1, cmake, subversion, ninja, etc.
19
20ADD checksums /tmp/checksums
21ADD scripts /tmp/scripts
Ilya Biryukov2bf7c512018-04-20 10:19:38 +000022
23# Checkout the source code.
24ARG checkout_args
25RUN /tmp/scripts/checkout.sh ${checkout_args}
26# Run the build. Results of the build will be available at /tmp/clang-install/.
Ilya Biryukovd9502012018-03-26 15:12:30 +000027ARG buildscript_args
Ilya Biryukov2bf7c512018-04-20 10:19:38 +000028RUN /tmp/scripts/build_install_llvm.sh --to /tmp/clang-install ${buildscript_args}
Ilya Biryukovd9502012018-03-26 15:12:30 +000029
30
31# Stage 2. Produce a minimal release image with build results.
32# FIXME: Replace 'ubuntu' with your base image.
33FROM ubuntu
34# FIXME: Change maintainer name.
35LABEL maintainer "Maintainer <maintainer@email>"
36# FIXME: Install all packages you want to have in your release container.
37# A minimal useful installation should include at least libstdc++ and binutils.
38
39# Copy build results of stage 1 to /usr/local.
40COPY --from=builder /tmp/clang-install/ /usr/local/