fix(snmp): ship MIB parser binary in API container with pre-loaded MIBs

- Build tod-mib-parser in both poller and API Dockerfiles
- Bundle 16 standard MIBs (IF-MIB, HOST-RESOURCES, SNMPv2, etc.)
- Pass --search-path /app/mibs to parser so dependencies resolve
- Users no longer need to upload standard MIBs manually

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Staack
2026-03-22 00:22:55 -05:00
parent 4c21539e40
commit 83f11cc739
19 changed files with 22538 additions and 1 deletions

View File

@@ -1,4 +1,12 @@
# Multi-stage build for TOD API
# Stage 0: build MIB parser binary from Go source
FROM golang:1.25-alpine AS mib-builder
WORKDIR /build
COPY poller/go.mod poller/go.sum ./
RUN go mod download
COPY poller/ .
RUN CGO_ENABLED=0 GOOS=linux GOMAXPROCS=1 go build -o /tod-mib-parser ./cmd/mib-parser
# Stage 1: build — install Python deps
FROM python:3.12-slim AS builder
@@ -42,6 +50,12 @@ WORKDIR /app
# Copy installed packages from builder
COPY --from=builder /install /usr/local
# Copy MIB parser binary from Go builder stage
COPY --from=mib-builder /tod-mib-parser /app/tod-mib-parser
# Copy pre-loaded MIB files for common vendor support
COPY backend/mibs/ /app/mibs/
# Copy application source
COPY backend/ .