@@ -8,6 +8,11 @@ COPY go.mod ./
|
||||
RUN --mount=type=cache,target=/go/pkg/mod go mod download
|
||||
COPY . .
|
||||
RUN test -f ./cmd/dockwatch/main.go || (echo "ERROR: cmd/dockwatch/main.go missing from Docker build context; check .dockerignore" >&2; exit 1)
|
||||
# Keep the module graph in sync with the actual source tree. This is required for
|
||||
# Go 1.17+ module graph pruning when transitive dependencies must be recorded as
|
||||
# indirect requirements in go.mod. The project intentionally has no vendored deps.
|
||||
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
go mod tidy
|
||||
RUN --mount=type=cache,target=/go/pkg/mod --mount=type=cache,target=/root/.cache/go-build \
|
||||
CGO_ENABLED=0 GOOS=linux go build -trimpath \
|
||||
-ldflags="-s -w -X git.send.nrw/sendnrw/dockwatch/internal/buildinfo.Version=${VERSION} -X git.send.nrw/sendnrw/dockwatch/internal/buildinfo.Commit=${COMMIT} -X git.send.nrw/sendnrw/dockwatch/internal/buildinfo.Date=${BUILD_DATE}" \
|
||||
|
||||
Reference in New Issue
Block a user