Remove USER, VOLUME, and user creation — rootless podman runs as the host user and bind-mounts /srv/mcns directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
27 lines
501 B
Docker
27 lines
501 B
Docker
FROM golang:1.25-alpine AS builder
|
|
|
|
ARG VERSION=dev
|
|
|
|
RUN apk add --no-cache git
|
|
|
|
WORKDIR /build
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X main.version=${VERSION}" -o mcns ./cmd/mcns
|
|
|
|
FROM alpine:3.21
|
|
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
|
|
COPY --from=builder /build/mcns /usr/local/bin/mcns
|
|
|
|
WORKDIR /srv/mcns
|
|
EXPOSE 53/udp 53/tcp
|
|
EXPOSE 8443
|
|
EXPOSE 9443
|
|
|
|
ENTRYPOINT ["mcns"]
|
|
CMD ["server", "--config", "/srv/mcns/mcns.toml"]
|