-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
32 lines (27 loc) · 1.13 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
FROM python:3.13.0-slim-bookworm AS base
ENV CPPCHECK_VERSION=2.16.0
WORKDIR /tmp/cppcheck
RUN apt-get update -y \
&& apt-get install -y --no-install-recommends \
git \
make \
g++ \
z3 \
libz3-dev \
libpcre3-dev \
&& git clone --single-branch -b $CPPCHECK_VERSION https://github.com/danmar/cppcheck.git . \
&& make install USE_Z3=yes HAVE_RULES=yes MATCHCOMPILER=yes FILESDIR=/etc/cppcheck CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function" \
&& echo -e "#!/bin/sh\ncppcheck --dump .\n misra.py \`find . -name '*.dump' | tr '\n' ' '\` 2> misra-report.txt" > /usr/bin/misra && chmod +x /usr/bin/misra
FROM python:3.13.0-slim-bookworm
RUN pip install --trusted-host pypi.org pygments \
&& apt-get update -y \
&& apt-get install -y --no-install-recommends \
z3 \
libz3-dev \
libpcre3-dev \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /lib/apk /etc/apk /home /var /tmp /srv /media /mnt /run /sbin /opt
COPY --from=base /usr/bin/cppcheck /usr/bin/cppcheck-htmlreport /usr/bin/misra /usr/bin/*.py /usr/bin/
COPY --from=base /etc/cppcheck /etc/cppcheck
LABEL maintainer="begarco"
WORKDIR /src