Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions cmd/plugins/balloons/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@ RUN --mount=type=cache,target=/go/pkg/mod/ \
GOBIN=/debug-extras/bin go install -tags osusergo,netgo -ldflags "-extldflags=-static" github.com/go-delve/delve/cmd/dlv@latest; \
fi

# Fetch go dependencies in a separate layer for caching
# Fetch go dependencies in a separate layer for caching.
# If vendor/ is present in the build context (e.g. when using a
# local replace directive), use vendor mode and skip the download.
COPY go.mod go.sum .
COPY pkg/topology/ pkg/topology/
RUN --mount=type=cache,target=/go/pkg/mod/ go mod download
RUN --mount=type=cache,target=/go/pkg/mod/ \
if grep -q '^replace .* => /' go.mod 2>/dev/null; then \
echo "go.mod contains local replace; will rely on vendor/"; \
else \
go mod download; \
fi

# Build nri-resource-policy
COPY . .
Expand Down
Loading
Loading