diff --git a/Taskfile.yml b/Taskfile.yml index e5f7d84..5b7739d 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -16,6 +16,9 @@ tasks: cmds: - > GITHUB_REF= dagger -s call -m github.com/sagikazarmark/daggerverse/golangci-lint@${DAGGER_GOLANGCI_LINT_SHA} + with-linter-cache --cache golangci-lint + with-build-cache --cache go-build + with-module-cache --cache go-mod run --source . --config .golangci.yml stdout sources: - ./**/*.go diff --git a/containers/Dockerfile.plugin b/containers/Dockerfile.plugin index 4584be0..b35fcb6 100644 --- a/containers/Dockerfile.plugin +++ b/containers/Dockerfile.plugin @@ -16,6 +16,9 @@ COPY ../cmd/manager/main.go cmd/manager/main.go COPY ../api/ api/ COPY ../internal/ internal/ +ENV GOCACHE=/root/.cache/go-build +ENV GOMODCACHE=/go/pkg/mod + # Build # the GOARCH has not a default value to allow the binary be built according to the host where the command # was called. For example, if we call make docker-build in a local env which has the Apple Silicon M1 SO @@ -45,4 +48,4 @@ WORKDIR / COPY --from=gobuilder /workspace/manager . USER 65532:65532 -ENTRYPOINT ["/manager"] \ No newline at end of file +ENTRYPOINT ["/manager"] diff --git a/containers/Dockerfile.sidecar b/containers/Dockerfile.sidecar index f3345ab..b81f8bc 100644 --- a/containers/Dockerfile.sidecar +++ b/containers/Dockerfile.sidecar @@ -17,6 +17,9 @@ COPY ../go.sum go.sum # and so that source changes don't invalidate our downloaded layer RUN go mod download +ENV GOCACHE=/root/.cache/go-build +ENV GOMODCACHE=/go/pkg/mod + # Copy the go source COPY ../cmd/manager/main.go cmd/manager/main.go COPY ../api/ api/