2020-06-24 16:12:05 +00:00
# docker build -t yandex/clickhouse-binary-builder .
2020-03-22 21:10:14 +00:00
FROM ubuntu:19.10
2019-01-10 10:35:17 +00:00
2020-04-20 20:13:33 +00:00
RUN apt-get --allow-unauthenticated update -y && apt-get install --yes wget gnupg
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
2020-04-20 20:04:35 +00:00
RUN echo "deb [trusted=yes] http://apt.llvm.org/eoan/ llvm-toolchain-eoan-10 main" >> /etc/apt/sources.list
2019-05-20 09:51:52 +00:00
RUN apt-get --allow-unauthenticated update -y \
&& env DEBIAN_FRONTEND = noninteractive \
apt-get --allow-unauthenticated install --yes --no-install-recommends \
bash \
fakeroot \
ccache \
curl \
2019-09-06 19:19:41 +00:00
software-properties-common \
gnupg \
apt-transport-https \
ca-certificates
2019-05-20 09:51:52 +00:00
2018-10-04 17:07:00 +00:00
RUN apt-get update -y \
&& env DEBIAN_FRONTEND = noninteractive \
apt-get install --yes --no-install-recommends \
bash \
cmake \
2019-04-25 12:29:28 +00:00
ccache \
2018-10-04 17:07:00 +00:00
curl \
2019-07-29 11:04:25 +00:00
gcc-9 \
g++-9 \
2020-04-30 12:10:32 +00:00
llvm-10 \
2020-04-20 20:04:35 +00:00
clang-10 \
lld-10 \
clang-tidy-10 \
2020-03-22 21:10:14 +00:00
clang-9 \
lld-9 \
clang-tidy-9 \
2020-03-23 18:23:32 +00:00
clang-8 \
lld-8 \
clang-tidy-8 \
2018-12-29 10:10:35 +00:00
libicu-dev \
2018-10-04 17:07:00 +00:00
libreadline-dev \
ninja-build \
2019-04-25 14:31:08 +00:00
gperf \
2019-02-21 17:14:29 +00:00
git \
2020-05-14 09:45:22 +00:00
opencl-headers \
ocl-icd-libopencl1 \
intel-opencl-icd \
2019-04-19 04:07:15 +00:00
tzdata \
2019-09-06 19:19:41 +00:00
gperf \
2019-09-17 14:24:45 +00:00
cmake \
2019-09-20 19:57:09 +00:00
gdb \
2019-09-23 19:29:47 +00:00
rename \
2020-03-23 16:08:13 +00:00
wget \
build-essential
2019-09-27 13:25:51 +00:00
2020-03-03 12:32:54 +00:00
# This symlink required by gcc to find lld compiler
2020-04-20 20:04:35 +00:00
RUN ln -s /usr/bin/lld-10 /usr/bin/ld.lld
2020-02-07 20:59:51 +00:00
2020-04-20 20:04:35 +00:00
ENV CC = clang-10
ENV CXX = clang++-10
2019-09-23 19:29:47 +00:00
# libtapi is required to support .tbh format from recent MacOS SDKs
2020-06-25 06:23:25 +00:00
RUN git clone https://github.com/tpoechtrager/apple-libtapi.git \
&& cd apple-libtapi \
&& INSTALLPREFIX = /cctools ./build.sh \
&& ./install.sh \
2020-06-25 06:26:10 +00:00
&& cd .. \
2020-06-25 06:23:25 +00:00
&& rm -rf apple-libtapi
2019-09-23 19:29:47 +00:00
2019-10-24 12:56:30 +00:00
# Build and install tools for cross-linking to Darwin
2020-06-25 06:23:25 +00:00
RUN git clone https://github.com/tpoechtrager/cctools-port.git \
&& cd cctools-port/cctools \
&& ./configure --prefix= /cctools --with-libtapi= /cctools \
--target= x86_64-apple-darwin \
&& make install \
2020-06-25 06:26:10 +00:00
&& cd ../.. \
2020-06-25 06:23:25 +00:00
&& rm -rf cctools-port
2019-09-23 19:29:47 +00:00
2019-10-24 12:56:30 +00:00
# Download toolchain for Darwin
2019-09-23 19:29:47 +00:00
RUN wget https://github.com/phracker/MacOSX-SDKs/releases/download/10.14-beta4/MacOSX10.14.sdk.tar.xz
2019-10-24 12:56:30 +00:00
# Download toolchain for ARM
2020-03-22 21:10:14 +00:00
# It contains all required headers and libraries. Note that it's named as "gcc" but actually we are using clang for cross compiling.
2019-10-24 12:56:30 +00:00
RUN wget "https://developer.arm.com/-/media/Files/downloads/gnu-a/8.3-2019.03/binrel/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz?revision=2e88a73f-d233-4f96-b1f4-d8b36e9bb0b9&la=en" -O gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu.tar.xz
2018-10-04 17:07:00 +00:00
2020-05-07 12:32:17 +00:00
# Download toolchain for FreeBSD 11.3
RUN wget https://clickhouse-datasets.s3.yandex.net/toolchains/toolchains/freebsd-11.3-toolchain.tar.xz
2020-04-07 08:33:49 +00:00
2019-04-25 12:29:28 +00:00
COPY build.sh /
CMD [ "/bin/bash" , "/build.sh" ]