1*d9502010SIlya Biryukov#===- llvm/utils/docker/example/build/Dockerfile -------------------------===// 2*d9502010SIlya Biryukov# 3*d9502010SIlya Biryukov# The LLVM Compiler Infrastructure 4*d9502010SIlya Biryukov# 5*d9502010SIlya Biryukov# This file is distributed under the University of Illinois Open Source 6*d9502010SIlya Biryukov# License. See LICENSE.TXT for details. 7*d9502010SIlya Biryukov# 8*d9502010SIlya Biryukov#===----------------------------------------------------------------------===// 9*d9502010SIlya Biryukov# This is an example Dockerfile to build an image that compiles clang. 10*d9502010SIlya Biryukov# Replace FIXMEs to prepare your own image. 11*d9502010SIlya Biryukov 12*d9502010SIlya Biryukov# Stage 1. Check out LLVM source code and run the build. 13*d9502010SIlya Biryukov# FIXME: Replace 'ubuntu' with your base image 14*d9502010SIlya BiryukovFROM ubuntu as builder 15*d9502010SIlya Biryukov# FIXME: Change maintainer name 16*d9502010SIlya BiryukovLABEL maintainer "Maintainer <maintainer@email>" 17*d9502010SIlya Biryukov# FIXME: Install llvm/clang build dependencies here. Including compiler to 18*d9502010SIlya Biryukov# build stage1, cmake, subversion, ninja, etc. 19*d9502010SIlya Biryukov 20*d9502010SIlya BiryukovADD checksums /tmp/checksums 21*d9502010SIlya BiryukovADD scripts /tmp/scripts 22*d9502010SIlya Biryukov# Arguments passed to build_install_clang.sh. 23*d9502010SIlya BiryukovARG buildscript_args 24*d9502010SIlya Biryukov# Run the build. Results of the build will be available as /tmp/clang-install. 25*d9502010SIlya BiryukovRUN /tmp/scripts/build_install_llvm.sh ${buildscript_args} 26*d9502010SIlya Biryukov 27*d9502010SIlya Biryukov 28*d9502010SIlya Biryukov# Stage 2. Produce a minimal release image with build results. 29*d9502010SIlya Biryukov# FIXME: Replace 'ubuntu' with your base image. 30*d9502010SIlya BiryukovFROM ubuntu 31*d9502010SIlya Biryukov# FIXME: Change maintainer name. 32*d9502010SIlya BiryukovLABEL maintainer "Maintainer <maintainer@email>" 33*d9502010SIlya Biryukov# FIXME: Install all packages you want to have in your release container. 34*d9502010SIlya Biryukov# A minimal useful installation should include at least libstdc++ and binutils. 35*d9502010SIlya Biryukov 36*d9502010SIlya Biryukov# Copy build results of stage 1 to /usr/local. 37*d9502010SIlya BiryukovCOPY --from=builder /tmp/clang-install/ /usr/local/ 38