11# BUILD redisfab/clang:${CLANG_VER}-${ARCH}-${OSNICK}
22
3- ARG OSNICK=stretch
4- ARG CLANG_VER=12
5- ARG CMAKE_VER=3.18.3
3+ ARG OSNICK=bullseye
4+ ARG CLANG_VER=13
65ARG NINJA_VER=1.10.1
7- ARG REDIS_VER=6
86
97# ----------------------------------------------------------------------------------------------
108FROM debian:$OSNICK
@@ -13,23 +11,32 @@ ARG OSNICK
1311ARG CLANG_VER
1412ARG CMAKE_VER
1513ARG NINJA_VER
16- ARG REDIS_VER
1714
1815WORKDIR /build
1916SHELL ["/bin/bash" , "-c" ]
2017
2118# ----------------------------------------------------------------------------------------------
22- # Install Clang and prerequisites
19+ # Install prerequisites
2320
2421RUN apt-get -qq update
2522RUN apt-get install -y ca-certificates curl wget
2623RUN apt-get install -y software-properties-common apt-transport-https
2724RUN apt-get install -y git unzip lsb-release gnupg2 wget
2825
29- RUN wget https://people.debian.org/~paravoid/python-all/unofficial-python-all.asc -O /etc/apt/trusted.gpg.d/unofficial-python-all.asc
30- RUN echo "deb http://people.debian.org/~paravoid/python-all $(lsb_release -sc) main" >> /etc/apt/sources.list.d/python-all.list
31- RUN apt update
32- RUN apt-get install -y python3.6
26+ RUN git clone https://github.com/RedisLabsModules/readies.git
27+
28+ RUN ./readies/bin/getpy3
29+ RUN ./readies/bin/getcmake --usr
30+
31+ # install ninja
32+ RUN set -e ;\
33+ cd /tmp ;\
34+ wget -q https://github.com/ninja-build/ninja/releases/download/v${NINJA_VER}/ninja-linux.zip ;\
35+ unzip ninja-linux.zip ;\
36+ mv ninja /usr/local/bin/ninja
37+
38+ # ----------------------------------------------------------------------------------------------
39+ # Install Clang
3340
3441RUN set -e ;\
3542 wget -q https://apt.llvm.org/llvm.sh ;\
@@ -45,18 +52,6 @@ RUN set -e ;\
4552 cd /usr/bin ;\
4653 for f in llvm*-$CLANG_VER clang*-$CLANG_VER; do ln -sf $f ${f/%-$CLANG_VER/}; done
4754
48- # install cmake
49- RUN set -e ;\
50- wget -q -O /tmp/cmake.sh https://github.com/Kitware/CMake/releases/download/v${CMAKE_VER}/cmake-${CMAKE_VER}-Linux-x86_64.sh ;\
51- sh /tmp/cmake.sh --skip-license --prefix=/usr/local
52-
53- # install ninja
54- RUN set -e ;\
55- cd /tmp ;\
56- wget -q https://github.com/ninja-build/ninja/releases/download/v${NINJA_VER}/ninja-linux.zip ;\
57- unzip ninja-linux.zip ;\
58- mv ninja /usr/local/bin/ninja
59-
6055# build llvm for msan into /opt/llvm-project/build-msan
6156RUN set -e ;\
6257 cd /opt ;\
@@ -75,17 +70,12 @@ RUN set -e ;\
7570# ----------------------------------------------------------------------------------------------
7671# Build Redis with asan/msan instrumentation
7772
78- RUN git clone https://github.com/RedisLabsModules/readies.git
79- RUN wget -q -O /tmp/get-pip.py https://bootstrap.pypa.io/pip/3.5/get-pip.py
80- RUN chmod +x /tmp/get-pip.py
81- RUN python3 /tmp/get-pip.py
82- RUN python3 -m pip install -r readies/paella/requirements.txt
83-
8473ADD redis.blacklist /build/
8574
8675# build sanitizer-enabled redis-server(s)
8776# `--no-run` because Clang sanitizer requires SYS_PTRACE docker capability, which is not available in docker build
88- RUN ./readies/bin/getredis --no-run -v6.0 --suffix asan-6.0 --clang-asan --clang-san-blacklist /build/redis.blacklist
89- RUN ./readies/bin/getredis --no-run -v6.0 --suffix msan-6.0 --clang-msan --llvm-dir /opt/llvm-project/build-msan --clang-san-blacklist /build/redis.blacklist
90- RUN ./readies/bin/getredis --no-run -v6.2 --suffix asan-6.2 --clang-asan --clang-san-blacklist /build/redis.blacklist
91- RUN ./readies/bin/getredis --no-run -v6.2 --suffix msan-6.2 --clang-msan --llvm-dir /opt/llvm-project/build-msan --clang-san-blacklist /build/redis.blacklist
77+ RUN set -e ;\
78+ for redis_ver in 6.0 6.2; do \
79+ ./readies/bin/getredis --no-run -v $redis_ver --suffix asan-${redis_ver} --own-openssl --clang-asan --clang-san-blacklist /build/redis.blacklist ;\
80+ ./readies/bin/getredis --no-run -v $redis_ver --suffix msan-${redis_ver} --own-openssl --clang-msan --llvm-dir /opt/llvm-project/build-msan --clang-san-blacklist /build/redis.blacklist ;\
81+ done
0 commit comments