Files
gitlab-cleanup-handler/Dockerfile
T
renovate bdca10e1d7
gitlab-cleanup-handler / test (push) Successful in 25s
Unbound Release / Check Preconditions (push) Successful in 2s
Unbound Release / Create Tag (push) Skipped
gitlab-cleanup-handler / vulnerabilities (push) Successful in 32s
Unbound Release / Generate Changelog and Handle PR (push) Successful in 7s
Unbound Release / Create Release (push) Successful in 4s
Release / release (push) Successful in 2m28s
gitlab-cleanup-handler / build (push) Successful in 27s
chore(deps): update golang docker tag to v1.27.3 (#516)
2026-10-20 04:50:41 +00:00

29 lines
1.1 KiB
Docker

FROM amd64/golang:1.27.3@sha256:806880ee211370bb7d6c3b665d2d27357425116282b4c643e297b74655eb6f05 as build
WORKDIR /build
ENV CGO_ENABLED=0
ADD . /build
RUN if [ $(go mod tidy -v 2>&1 | grep -c unused) != 0 ]; then echo "Unused modules, please run 'go mod tidy'"; exit 1; fi
RUN go fmt ./...
RUN go vet ./...
RUN CGO_ENABLED=1 go test -mod=readonly -race -coverprofile=coverage.txt.tmp -covermode=atomic -coverpkg=$(go list ./... | tr '\n' , | sed 's/,$//') ./...
RUN ["/bin/bash", "-c", "cat coverage.txt.tmp | grep -v -f <(find . -type f | xargs grep -l 'Code generated') > coverage.txt"]
RUN go tool cover -html=coverage.txt -o coverage.html
RUN go tool cover -func=coverage.txt
RUN rm coverage.txt.tmp
RUN GOOS=linux GOARCH=amd64 go build \
-tags prod \
-a -installsuffix cgo \
-mod=readonly \
-o /release/handler \
-ldflags '-w -s' \
./cmd/handler/handler.go
FROM scratch as export
COPY --from=build /build/coverage.txt /
FROM scratch
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=build /release/handler /
CMD ["/handler"]