Files
pipeline-bridge/Dockerfile
Billy D. 338210eb74
Some checks failed
CI / Lint (push) Successful in 2m56s
CI / Test (push) Successful in 2m53s
CI / Release (push) Successful in 1m34s
CI / Docker Build & Push (push) Failing after 7m4s
CI / Notify (push) Successful in 1s
chore: bump handler-base to v0.1.5, add netrc secret mount to Dockerfile
2026-02-20 18:17:58 -05:00

35 lines
772 B
Docker

# Build stage
FROM golang:1.25-alpine AS builder
WORKDIR /app
# Install ca-certificates for HTTPS
RUN apk add --no-cache ca-certificates git
ENV GOPRIVATE=git.daviestechlabs.io
ENV GONOSUMCHECK=git.daviestechlabs.io
# Copy go mod files
COPY go.mod go.sum ./
RUN --mount=type=secret,id=netrc,target=/root/.netrc go mod download
# Copy source code
COPY . .
# Build static binary
RUN CGO_ENABLED=0 GOOS=linux GOAMD64=v3 go build -ldflags="-w -s" -o /pipeline-bridge .
# Runtime stage - scratch for minimal image
FROM scratch
# Copy CA certificates for HTTPS
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# Copy binary
COPY --from=builder /pipeline-bridge /pipeline-bridge
# Run as non-root
USER 65534:65534
ENTRYPOINT ["/pipeline-bridge"]