Debian Codegraph @

automation/build/debian/bookworm-cppcheck.dockerfile

raw
1 # syntax=docker/dockerfile:1
2 FROM --platform=linux/arm64/v8 debian:bookworm AS builder
3
4 ENV DEBIAN_FRONTEND=noninteractive
5 ENV CPPCHECK_VERSION=2.7
6 ENV USER root
7
8 # dependencies for cppcheck build
9 RUN apt-get update && \
10 apt-get --quiet --yes install \
11 curl \
12 build-essential \
13 python-is-python3 \
14 libpcre3-dev
15
16 RUN mkdir /build
17 WORKDIR /build
18
19 # cppcheck release build (see cppcheck readme.md)
20 RUN curl -fsSLO https://github.com/danmar/cppcheck/archive/"$CPPCHECK_VERSION".tar.gz && \
21 tar xvzf "$CPPCHECK_VERSION".tar.gz && \
22 cd cppcheck-"$CPPCHECK_VERSION" && \
23 make install -j$(nproc) \
24 MATCHCOMPILER=yes \
25 FILESDIR=/usr/share/cppcheck \
26 HAVE_RULES=yes CXXFLAGS="-O2 -DNDEBUG -Wall -Wno-sign-compare -Wno-unused-function"
27
28 FROM --platform=linux/arm64/v8 debian:bookworm
29 COPY --from=builder /usr/bin/cppcheck /usr/bin/cppcheck
30 COPY --from=builder /usr/share/cppcheck /usr/share/cppcheck
31
32 LABEL maintainer.name="The Xen Project" \
33 maintainer.email="[email protected]"
34
35 ENV DEBIAN_FRONTEND=noninteractive
36 ENV USER root
37
38 RUN mkdir /build
39 WORKDIR /build
40
41 # dependencies for cppcheck analysis including Xen-only build/cross-build
42 RUN apt-get update && \
43 apt-get --quiet --yes install \
44 build-essential \
45 python-is-python3 \
46 libpcre3-dev \
47 flex \
48 bison \
49 gcc-arm-linux-gnueabihf \
50 gcc-x86-64-linux-gnu \
51 && \
52 apt-get autoremove -y && \
53 apt-get clean && \
54 rm -rf /var/lib/apt/lists* /tmp/* /var/tmp/*