Files
cron-checker/Dockerfile
T
renovate 56bd60efd1
Unbound Release / Check Preconditions (push) Successful in 36s
Unbound Release / Create Tag (push) Skipped
Unbound Release / Generate Changelog and Handle PR (push) Successful in 55s
Unbound Release / Create Release (push) Successful in 47s
Release / release (push) Successful in 2m0s
cron-checker / build (push) Failing after 1h14m6s
cron-checker / test (push) Successful in 1m9s
cron-checker / vulnerabilities (push) Successful in 1m22s
chore(deps): update golang:1.26.5 docker digest to 046e320 (#388)
2026-08-09 20:02:54 +00:00

22 lines
1.0 KiB
Docker

FROM amd64/golang:1.26.5@sha256:046e3207184bda57d569e7834781130b3c0f3e18fad78e86ad748eabd397f0ef 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 CGO_ENABLED=0 go build -mod=readonly -o release/cron-checker -ldflags '-w -s'
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 /build/release/cron-checker /
CMD ["/cron-checker"]