ossf / scorecard

OpenSSF Scorecard - Security health metrics for Open Source
https://scorecard.dev
Apache License 2.0
4.27k stars 463 forks source link

BUG - Cron docker builds are broken #378

Closed naveensrinivasan closed 3 years ago

naveensrinivasan commented 3 years ago

Describe the bug The docker build for the cronjob is broken

docker build \
    -t gcr.io/openssf/cron:latest \
    -f ./cron/Dockerfile \
Sending build context to Docker daemon  23.26MB
Step 1/19 : FROM  golang:1.16.3 as base
 ---> d5dc529b0ee7
Step 2/19 : WORKDIR /src
 ---> Using cache
 ---> fad147901e8a
Step 3/19 : ENV CGO_ENABLED=0
 ---> Using cache
 ---> babc165fed14
Step 4/19 : COPY go.* ./
 ---> bc0e24beb80b
Step 5/19 : RUN go mod download
 ---> Running in a60e12d94814
Removing intermediate container a60e12d94814
 ---> 83b398d3ad7b
Step 6/19 : COPY . ./
 ---> b651b7083382
Step 7/19 : FROM base AS build
 ---> b651b7083382
Step 8/19 : ARG TARGETOS
 ---> Running in 59426f07613b
Removing intermediate container 59426f07613b
 ---> 0c703fac35b7
Step 9/19 : ARG TARGETARCH
 ---> Running in dbe3559e31e2
Removing intermediate container dbe3559e31e2
 ---> 6f0083a626ae
Step 10/19 : RUN CGO_ENABLED=0 make build
 ---> Running in a14943fce553
CGO_ENABLED=0 go build -a -tags netgo -ldflags '-w -extldflags "-static"'
Removing intermediate container a14943fce553
 ---> e4c240305798
Step 11/19 : FROM base AS cron
 ---> b651b7083382
Step 12/19 : ARG TARGETOS
 ---> Using cache
 ---> 0c703fac35b7
Step 13/19 : ARG TARGETARCH
 ---> Using cache
 ---> 6f0083a626ae
Step 14/19 : RUN CGO_ENABLED=0 make build-cron
 ---> Running in b0f2301e78c6
cd cron && CGO_ENABLED=0 go build -a -ldflags '-w -extldflags "-static"' -o scorecardcron
main.go:26:2: no required module provides package github.com/jszwec/csvutil; to add it:
    go get github.com/jszwec/csvutil
main.go:27:2: no required module provides package github.com/ossf/scorecard/checks; to add it:
    go get github.com/ossf/scorecard/checks
main.go:28:2: no required module provides package github.com/ossf/scorecard/pkg; to add it:
    go get github.com/ossf/scorecard/pkg
main.go:29:2: no required module provides package github.com/ossf/scorecard/repos; to add it:
    go get github.com/ossf/scorecard/repos
main.go:30:2: no required module provides package go.uber.org/zap; to add it:
    go get go.uber.org/zap
make: *** [Makefile:35: build-cron] Error 1
The command '/bin/sh -c CGO_ENABLED=0 make build-cron' returned a non-zero code: 2
naveensrinivasan commented 3 years ago

@azeemshaikh38 with the latest refactoring without the go.mod caused this to break.

naveensrinivasan commented 3 years ago

Sorry, I had a dangling file that was causing this issue. It is not an issue