diff --git a/Dockerfile b/Dockerfile index e180576838358..c8a9d8782ff12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,13 +37,6 @@ FROM golatest AS gobuild-base RUN apk add --no-cache file bash clang lld musl-dev pkgconfig git make COPY --link --from=xx / / -# dlv builds delve for debug variant images -FROM gobuild-base AS dlv -ARG DELVE_VERSION -RUN --mount=target=/root/.cache,type=cache \ - --mount=target=/go/pkg/mod,type=cache \ - GOBIN=/usr/bin go install github.com/go-delve/delve/cmd/dlv@${DELVE_VERSION} - # runc builds runc binary FROM gobuild-base AS runc WORKDIR $GOPATH/src/github.com/opencontainers/runc @@ -337,6 +330,23 @@ rmdir "$coverdir/helpers" exit $ecode EOF +# dlv builds delve for debug variant images +FROM gobuild-base AS dlv +ARG DELVE_VERSION +ARG TARGETPLATFORM +RUN --mount=target=/root/.cache,type=cache\ + --mount=target=/go/pkg/mod,type=cache <