Files
spine/Dockerfile.dev
T
Thomas Vincent bae4dd32c0 Add Dockerfile for building and verifying spine (#401)
Fixes #444

- **Dockerfile**: multi-stage build. Builder stage compiles spine; final
stage is minimal, non-root, with only required shared libs.
- **Dockerfile.dev**: single-stage dev image with ASan, cppcheck,
scan-build, valgrind, and gdb. Defaults to running scripts/verify.sh
(cppcheck + scan-build + smoke tests).
- **scripts/verify.sh**: runs cppcheck, scan-build, and basic
--help/--version smoke tests.
- **.dockerignore**: excludes .git and build artifacts.

Nothing changes about the existing build. Purely additive.

---------

Signed-off-by: Thomas Vincent <thomasvincent@gmail.com>
2026-03-08 09:40:38 -04:00

42 lines
1.2 KiB
Docker

# +-------------------------------------------------------------------------+
# | Copyright (C) 2004-2024 The Cacti Group |
# +-------------------------------------------------------------------------+
# | Development/verification image — NOT for production use. |
# | Builds with ASan + full static analysis tooling. |
# +-------------------------------------------------------------------------+
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
autoconf \
automake \
libtool \
dos2unix \
help2man \
libmariadb-dev \
libsnmp-dev \
libssl-dev \
zlib1g-dev \
cppcheck \
clang-tools \
valgrind \
gdb \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY . .
# ASan build: catches heap/stack overflows and use-after-free at runtime.
# -fno-omit-frame-pointer gives usable stack traces under valgrind/gdb.
RUN ./bootstrap \
&& CFLAGS="-fsanitize=address -fno-omit-frame-pointer -g -Wall -Wextra" \
./configure --enable-warnings \
&& make -j"$(nproc)"
COPY scripts/verify.sh /usr/local/bin/verify.sh
RUN chmod +x /usr/local/bin/verify.sh
CMD ["/usr/local/bin/verify.sh"]