1 #===- llvm/utils/docker/example/build/Dockerfile -------------------------===//
3 # The LLVM Compiler Infrastructure
5 # This file is distributed under the University of Illinois Open Source
6 # License. See LICENSE.TXT for details.
8 #===----------------------------------------------------------------------===//
9 # This is an example Dockerfile to build an image that compiles clang.
10 # Replace FIXMEs to prepare your own image.
12 # Stage 1. Check out LLVM source code and run the build.
13 # FIXME: Replace 'ubuntu' with your base image
14 FROM ubuntu as builder
15 # FIXME: Change maintainer name
16 LABEL maintainer "Maintainer <maintainer@email>"
17 # FIXME: Install llvm/clang build dependencies here. Including compiler to
18 # build stage1, cmake, subversion, ninja, etc.
20 ADD checksums /tmp/checksums
21 ADD scripts /tmp/scripts
23 # Checkout the source code.
25 RUN /tmp/scripts/checkout.sh ${checkout_args}
26 # Run the build. Results of the build will be available at /tmp/clang-install/.
28 RUN /tmp/scripts/build_install_llvm.sh --to /tmp/clang-install ${buildscript_args}
31 # Stage 2. Produce a minimal release image with build results.
32 # FIXME: Replace 'ubuntu' with your base image.
34 # FIXME: Change maintainer name.
35 LABEL 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.
39 # Copy build results of stage 1 to /usr/local.
40 COPY --from=builder /tmp/clang-install/ /usr/local/