diff --git a/kotlin-native/tools/llvm_builder/Dockerfile b/kotlin-native/tools/llvm_builder/Dockerfile new file mode 100644 index 00000000000..939a1f15231 --- /dev/null +++ b/kotlin-native/tools/llvm_builder/Dockerfile @@ -0,0 +1,25 @@ +FROM ubuntu:16.04 + +ENV TZ=Europe/Moscow +RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + +RUN apt-get update +RUN apt-get install -y git cmake curl unzip ninja-build gcc g++ build-essential zlib1g-dev + +# Build Python. +RUN cd /opt && \ + curl -LO https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz && \ + tar -xf Python-3.6.9.tgz && \ + cd Python-3.6.9 && \ + ./configure && make && make install + +# Create a user. +ARG USERNAME=jb +RUN groupadd -g 1000 $USERNAME +RUN useradd -r -u 1000 --create-home -g $USERNAME $USERNAME +USER $USERNAME +WORKDIR /home/$USERNAME + +COPY package.py . + +ENTRYPOINT ["python3.6", "package.py"] diff --git a/kotlin-native/tools/llvm_builder/README.md b/kotlin-native/tools/llvm_builder/README.md index da5ac9e43c5..ecea878cae5 100644 --- a/kotlin-native/tools/llvm_builder/README.md +++ b/kotlin-native/tools/llvm_builder/README.md @@ -30,6 +30,15 @@ Some examples: means that LLVM will build itself by using distribution from the previous step. * `--stage0` allows using existing LLVM toolchain for bootstrapping. +### Docker + +You can use Docker to build LLVM for Linux: +```shell +docker build -t kotlin-llvm-builder . +docker run --rm -it -v :/output kotlin-llvm-builder --archive-path /output/llvm-11.1.0-linux-x64 + +``` + ### Known problems 1. Bootstrap build is not working on macOS for default git branch. 2. `libcxx` and `compiler-rt` are built as projects, not runtimes.