2021-09-24 10:48:28 +00:00
# docker build -t clickhouse/test-util .
2021-09-28 08:50:28 +00:00
FROM ubuntu:20.04
2022-07-29 12:31:53 +00:00
# ARG for quick switch to a given ubuntu mirror
ARG apt_archive = "http://archive.ubuntu.com"
RUN sed -i " s|http://archive.ubuntu.com| $apt_archive |g " /etc/apt/sources.list
2022-10-16 21:11:29 +00:00
# 15.0.2
2023-03-18 22:45:57 +00:00
ENV DEBIAN_FRONTEND = noninteractive LLVM_VERSION = 16
2022-07-29 12:31:53 +00:00
RUN apt-get update \
&& apt-get install \
apt-transport-https \
apt-utils \
ca-certificates \
2022-11-25 10:37:30 +00:00
curl \
2022-07-29 12:31:53 +00:00
dnsutils \
gnupg \
iputils-ping \
lsb-release \
wget \
--yes --no-install-recommends --verbose-versions \
&& export LLVM_PUBKEY_HASH = "bda960a8da687a275a2078d43c111d66b1c6a893a3275271beedf266c1ff4a0cdecb429c7a5cccf9f486ea7aa43fd27f" \
&& wget -nv -O /tmp/llvm-snapshot.gpg.key https://apt.llvm.org/llvm-snapshot.gpg.key \
&& echo " ${ LLVM_PUBKEY_HASH } /tmp/llvm-snapshot.gpg.key " | sha384sum -c \
&& apt-key add /tmp/llvm-snapshot.gpg.key \
&& export CODENAME = " $( lsb_release --codename --short | tr 'A-Z' 'a-z' ) " \
2022-11-25 10:37:30 +00:00
&& echo " deb https://apt.llvm.org/ ${ CODENAME } / llvm-toolchain- ${ CODENAME } - ${ LLVM_VERSION } main " >> \
2022-07-29 12:31:53 +00:00
/etc/apt/sources.list \
&& apt-get clean
2022-11-25 10:37:30 +00:00
# Install cmake 3.20+ for rust support
# Used https://askubuntu.com/a/1157132 as reference
RUN curl -s https://apt.kitware.com/keys/kitware-archive-latest.asc | \
gpg --dearmor - > /etc/apt/trusted.gpg.d/kitware.gpg && \
echo " deb https://apt.kitware.com/ubuntu/ $( lsb_release -cs) main " >> /etc/apt/sources.list
2022-07-29 12:31:53 +00:00
# initial packages
RUN apt-get update \
&& apt-get install \
bash \
bsdmainutils \
build-essential \
clang-${ LLVM_VERSION } \
clang-tidy-${ LLVM_VERSION } \
cmake \
fakeroot \
gdb \
git \
gperf \
2023-02-02 12:40:04 +00:00
libclang-rt-${ LLVM_VERSION } -dev \
2022-07-29 12:31:53 +00:00
lld-${ LLVM_VERSION } \
llvm-${ LLVM_VERSION } \
llvm-${ LLVM_VERSION } -dev \
2023-05-09 08:25:50 +00:00
libclang-${ LLVM_VERSION } -dev \
2022-07-29 12:31:53 +00:00
moreutils \
nasm \
ninja-build \
pigz \
rename \
software-properties-common \
tzdata \
--yes --no-install-recommends \
&& apt-get clean
# This symlink required by gcc to find lld compiler
RUN ln -s /usr/bin/lld-${ LLVM_VERSION } /usr/bin/ld.lld
2022-09-06 12:12:05 +00:00
# for external_symbolizer_path
RUN ln -s /usr/bin/llvm-symbolizer-${ LLVM_VERSION } /usr/bin/llvm-symbolizer
2022-10-17 08:22:26 +00:00
# FIXME: workaround for "The imported target "merge-fdata" references the file" error
# https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/commit/992e52c0b156a5ba9c6a8a54f8c4857ddd3d371d
RUN sed -i '/_IMPORT_CHECK_FILES_FOR_\(mlir-\|llvm-bolt\|merge-fdata\|MLIR\)/ {s|^|#|}' /usr/lib/llvm-${ LLVM_VERSION } /lib/cmake/llvm/LLVMExports-*.cmake
2022-07-29 12:31:53 +00:00
ARG CCACHE_VERSION = 4 .6.1
RUN mkdir /tmp/ccache \
&& cd /tmp/ccache \
&& curl -L \
-O https://github.com/ccache/ccache/releases/download/v$CCACHE_VERSION /ccache-$CCACHE_VERSION .tar.xz \
-O https://github.com/ccache/ccache/releases/download/v$CCACHE_VERSION /ccache-$CCACHE_VERSION .tar.xz.asc \
&& gpg --recv-keys --keyserver hkps://keyserver.ubuntu.com 5A939A71A46792CF57866A51996DDA075594ADB8 \
&& gpg --verify ccache-4.6.1.tar.xz.asc \
&& tar xf ccache-$CCACHE_VERSION .tar.xz \
&& cd /tmp/ccache/ccache-$CCACHE_VERSION \
&& cmake -DCMAKE_INSTALL_PREFIX= /usr \
-DCMAKE_BUILD_TYPE= None \
-DZSTD_FROM_INTERNET= ON \
-DREDIS_STORAGE_BACKEND= OFF \
-Wno-dev \
-B build \
-S . \
&& make VERBOSE = 1 -C build \
&& make install -C build \
&& cd / \
&& rm -rf /tmp/ccache
2023-02-09 15:43:24 +00:00
ARG TARGETARCH
ARG SCCACHE_VERSION = v0.4.1
RUN arch = ${ TARGETARCH :- amd64 } \
&& case $arch in \
amd64) rarch = x86_64 ; ; \
arm64) rarch = aarch64 ; ; \
esac \
&& curl -Ls " https://github.com/mozilla/sccache/releases/download/ $SCCACHE_VERSION /sccache- $SCCACHE_VERSION - $rarch -unknown-linux-musl.tar.gz " | \
tar xz -C /tmp \
&& mv " /tmp/sccache- $SCCACHE_VERSION - $rarch -unknown-linux-musl/sccache " /usr/bin \
&& rm " /tmp/sccache- $SCCACHE_VERSION - $rarch -unknown-linux-musl " -r
2021-09-24 10:48:28 +00:00
COPY process_functional_tests_result.py /