1 # Copyright (c) 2019 AT&T Intellectual Property.
2 # Copyright (c) 2019 Nokia.
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 # This source code is part of the near-RT RIC (RAN Intelligent Controller)
18 # platform project (RICP).
22 # Alpine-linux based containers use musl implementation of libc which causes
23 # valgrind to emit false positives. Therefore we run UT with valgrind in
24 # a separate build stage that uses ubuntu container with GNU libc installed.
26 # NOTE: The valgrind false positive problem could also potentially be solved
27 # with valgrind suppression files but that kind of approach may be fragile.
28 FROM ubuntu:19.10 as cpputest-build
44 # Cpputest built-in memory checks generate false positives in valgrind.
45 # This is solved by compiling cpputest with memory checking disabled.
47 RUN curl -L https://github.com/cpputest/cpputest/releases/download/v3.8/cpputest-3.8.tar.gz | \
48 tar --strip-components=1 -xzf -
49 WORKDIR /cpputest/builddir
50 RUN cmake -DMEMORY_LEAK_DETECTION=OFF .. && \
53 COPY ./redismodule /redismodule
60 FROM nexus3.o-ran-sc.org:10004/o-ran-sc/bldr-alpine3:12-a3.11 as build-env
63 COPY ./redismodule /redismodule
66 ./configure --disable-unit-test-memcheck && \
71 FROM redis:5.0.5-alpine3.9 as build
74 COPY --from=build-env /usr/local/libexec/redismodule/libredismodule.so /usr/local/libexec/redismodule/libredismodule.so