1d9502010SIlya Biryukov#===- llvm/utils/docker/example/build/Dockerfile -------------------------===// 2d9502010SIlya Biryukov# 3*2946cd70SChandler Carruth# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*2946cd70SChandler Carruth# See https://llvm.org/LICENSE.txt for license information. 5*2946cd70SChandler Carruth# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6d9502010SIlya Biryukov# 7d9502010SIlya Biryukov#===----------------------------------------------------------------------===// 8d9502010SIlya Biryukov# This is an example Dockerfile to build an image that compiles clang. 9d9502010SIlya Biryukov# Replace FIXMEs to prepare your own image. 10d9502010SIlya Biryukov 11d9502010SIlya Biryukov# Stage 1. Check out LLVM source code and run the build. 12d9502010SIlya Biryukov# FIXME: Replace 'ubuntu' with your base image 13d9502010SIlya BiryukovFROM ubuntu as builder 14d9502010SIlya Biryukov# FIXME: Change maintainer name 15d9502010SIlya BiryukovLABEL maintainer "Maintainer <maintainer@email>" 16d9502010SIlya Biryukov# FIXME: Install llvm/clang build dependencies here. Including compiler to 17d9502010SIlya Biryukov# build stage1, cmake, subversion, ninja, etc. 18d9502010SIlya Biryukov 19d9502010SIlya BiryukovADD checksums /tmp/checksums 20d9502010SIlya BiryukovADD scripts /tmp/scripts 212bf7c51dSIlya Biryukov 222bf7c51dSIlya Biryukov# Checkout the source code. 232bf7c51dSIlya BiryukovARG checkout_args 242bf7c51dSIlya BiryukovRUN /tmp/scripts/checkout.sh ${checkout_args} 252bf7c51dSIlya Biryukov# Run the build. Results of the build will be available at /tmp/clang-install/. 26d9502010SIlya BiryukovARG buildscript_args 272bf7c51dSIlya BiryukovRUN /tmp/scripts/build_install_llvm.sh --to /tmp/clang-install ${buildscript_args} 28d9502010SIlya Biryukov 29d9502010SIlya Biryukov 30d9502010SIlya Biryukov# Stage 2. Produce a minimal release image with build results. 31d9502010SIlya Biryukov# FIXME: Replace 'ubuntu' with your base image. 32d9502010SIlya BiryukovFROM ubuntu 33d9502010SIlya Biryukov# FIXME: Change maintainer name. 34d9502010SIlya BiryukovLABEL maintainer "Maintainer <maintainer@email>" 35d9502010SIlya Biryukov# FIXME: Install all packages you want to have in your release container. 36d9502010SIlya Biryukov# A minimal useful installation should include at least libstdc++ and binutils. 37d9502010SIlya Biryukov 38d9502010SIlya Biryukov# Copy build results of stage 1 to /usr/local. 39d9502010SIlya BiryukovCOPY --from=builder /tmp/clang-install/ /usr/local/ 40