external-dns-domeneshop-web.../Dockerfile
Mooo[bot] 5929e1743b
All checks were successful
Release / build-image (push) Successful in 39s
chore(deps): update golang docker tag to v1.24.2
2025-04-02 01:00:35 +00:00

36 lines
777 B
Docker

# syntax=docker/dockerfile:1
# We use a multi-stage build setup.
# (https://docs.docker.com/build/building/multi-stage/)
# Stage 1 (to create a "build" image, ~850MB)
FROM golang:1.24.2 AS builder
LABEL org.opencontainers.image.source="https://code.252.no/pub/external-dns-domeneshop-webhook"
WORKDIR /src/
COPY src/go.mod src/go.sum ./
RUN go mod download
COPY src/ ./
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build \
-trimpath \
-ldflags="-w -s" \
-o /app
#Commented-out until tests are ready..
#RUN go test -cover -v ./...
# Stage 2 (to create a downsized "container executable", ~5MB)
FROM gcr.io/distroless/base-debian11 AS build-release-stage
WORKDIR /
COPY --from=builder /app /app
EXPOSE 8080
USER nonroot:nonroot
ENTRYPOINT ["./app"]