hack/make/.binary: use with-go-mod.sh
Signed-off-by: Bjorn Neergaard <bjorn.neergaard@docker.com>
(cherry picked from commit a972dbd682
)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
314b84b023
commit
e67f9dadc6
1 changed files with 1 additions and 9 deletions
|
@ -74,19 +74,11 @@ source "${MAKEDIR}/.go-autogen"
|
|||
fi
|
||||
fi
|
||||
|
||||
# This is a workaround to have buildinfo with deps embedded in the binary. We
|
||||
# need to create a go.mod file before building with -modfile=vendor.mod,
|
||||
# otherwise it fails with: "-modfile cannot be used to set the module root directory."
|
||||
if [ ! -f "go.mod" ]; then
|
||||
printf '%s\n\n%s' 'module github.com/docker/docker' 'go 1.19' > "go.mod"
|
||||
trap 'rm -f go.mod' EXIT
|
||||
fi
|
||||
|
||||
echo "Building $([ "$DOCKER_STATIC" = "1" ] && echo "static" || echo "dynamic") $DEST/$BINARY_FULLNAME ($PLATFORM_NAME)..."
|
||||
if [ -n "$DOCKER_DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
GO111MODULE=on go build -mod=vendor -modfile=vendor.mod -o "$DEST/$BINARY_FULLNAME" "${BUILDFLAGS[@]}" -ldflags "$LDFLAGS $LDFLAGS_STATIC $DOCKER_LDFLAGS" ${GO_PACKAGE}
|
||||
./hack/with-go-mod.sh go build -mod=vendor -modfile=vendor.mod -o "$DEST/$BINARY_FULLNAME" "${BUILDFLAGS[@]}" -ldflags "$LDFLAGS $LDFLAGS_STATIC $DOCKER_LDFLAGS" "$GO_PACKAGE"
|
||||
)
|
||||
|
||||
echo "Created binary: $DEST/$BINARY_FULLNAME"
|
||||
|
|
Loading…
Reference in a new issue