From 5b58909b379a11a17e57f87246b57429224be916 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Fri, 11 Oct 2024 04:21:44 +0000 Subject: [PATCH] Get package from go.mod Signed-off-by: Brad Davidson --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8c69327..00cfbb0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,8 +19,8 @@ WORKDIR $GOPATH/src/${PKG} RUN git fetch --all --tags --prune RUN git checkout tags/${TAG} -b ${TAG} RUN go mod edit -replace github.com/docker/docker=github.com/docker/docker@v27.1.1+incompatible && go mod tidy && go mod vendor -ENV GO_LDFLAGS="-linkmode=external -X ${PKG}/pkg/version.Version=${TAG}" -RUN go-build-static.sh -gcflags=-trimpath=${GOPATH}/src -o bin/crictl ./cmd/crictl +RUN GO_LDFLAGS="-linkmode=external -X $(awk '/^module /{print $2}' go.mod)/pkg/version.Version=${TAG}" \ + go-build-static.sh -gcflags=-trimpath=${GOPATH}/src -o bin/crictl ./cmd/crictl RUN go-assert-static.sh bin/* RUN if [ "${ARCH}" = "amd64" ]; then \ go-assert-boring.sh bin/* ; \