Files
energy-meter/Dockerfile
Thomas Klaehn 2dcfaeacb7 Fix broker connectivity: support scoped IPv6 link-local addresses
Add optional broker_ip and broker_tls_name config fields so the TCP
dial target can be a scoped IPv6 address (fe80::...%eth0) while TLS
certificate verification still uses the broker hostname.

Also revert to alpine/static build; CGO was not needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 08:17:30 +02:00

14 lines
364 B
Docker

FROM golang:1.24-bookworm AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
RUN CGO_ENABLED=0 go build -o energy-mqtt-sub .
FROM alpine:3.21
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
COPY --from=builder /app/energy-mqtt-sub .
USER nobody:nobody
ENTRYPOINT ["./energy-mqtt-sub", "-c", "/srv/energy/meter/config.json"]