Skip to content

Commit 7ab579d

Browse files
committed
ci(docker): switch CppCheck installation from apt to manual
Prebuilt version of CppCheck does not meet the requirement (>=2.16.0)
1 parent aa2fe2f commit 7ab579d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ RUN apt update -qq && \
2828
cloc \
2929
openjdk-17-jdk-headless maven \
3030
build-essential bear \
31-
-y -qq --no-install-recommends && \
32-
rm -rf /var/lib/apt/lists/*
31+
-y -qq --no-install-recommends
3332

3433
RUN groupadd -g $GID codesectools && \
3534
useradd -l -u $UID -g codesectools -m codesectools -s /bin/bash && \
@@ -60,9 +59,11 @@ RUN curl -sL https://github.com/spotbugs/spotbugs/releases/download/4.9.8/spotbu
6059
ENV PATH="/home/codesectools/sasts/spotbugs/bin:$PATH"
6160

6261
# Cppcheck
63-
RUN sudo apt update -qq && \
64-
DEBIAN_FRONTEND=noninteractive sudo apt install cppcheck -y -qq --no-install-recommends && \
65-
sudo rm -rf /var/lib/apt/lists/*
62+
RUN sudo apt install -y -qq --no-install-recommends libpcre3-dev && \
63+
curl -sL https://github.com/danmar/cppcheck/archive/refs/tags/2.19.0.tar.gz | tar -xzvf - && \
64+
mv cppcheck-* /home/codesectools/sasts/cppcheck && \
65+
(cd /home/codesectools/sasts/cppcheck && make -j$(nproc) MATCHCOMPILER=yes HAVE_RULES=yes CXXOPTS="-O2" CPPOPTS="-DNDEBUG")
66+
ENV PATH="/home/codesectools/sasts/cppcheck:$PATH"
6667

6768
# =========================== CodeSecTools ===========================
6869
COPY --from=builder --chown=codesectools:codesectools /app /app

0 commit comments

Comments
 (0)