Skip to content

Commit

Permalink
hack: display build cmd when DOCKER_DEBUG set
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
(cherry picked from commit 170a1c4)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
  • Loading branch information
crazy-max authored and thaJeztah committed Jan 30, 2023
1 parent b7e0725 commit 699e853
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
13 changes: 4 additions & 9 deletions hack/make/.binary
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,10 @@ source "${MAKEDIR}/.go-autogen"
fi

echo "Building $([ "$DOCKER_STATIC" = "1" ] && echo "static" || echo "dynamic") $DEST/$BINARY_FULLNAME ($PLATFORM_NAME)..."
go build \
-o "$DEST/$BINARY_FULLNAME" \
"${BUILDFLAGS[@]}" \
-ldflags "
$LDFLAGS
$LDFLAGS_STATIC
$DOCKER_LDFLAGS
" \
${GO_PACKAGE}
if [ -n "$DOCKER_DEBUG" ]; then
set -x
fi
go build -o "$DEST/$BINARY_FULLNAME" "${BUILDFLAGS[@]}" -ldflags "$LDFLAGS $LDFLAGS_STATIC $DOCKER_LDFLAGS" ${GO_PACKAGE}
)

echo "Created binary: $DEST/$BINARY_FULLNAME"
13 changes: 6 additions & 7 deletions hack/make/.go-autogen
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#!/usr/bin/env bash

LDFLAGS="${LDFLAGS} \
-X \"github.com/docker/docker/dockerversion.Version=${VERSION}\" \
-X \"github.com/docker/docker/dockerversion.GitCommit=${GITCOMMIT}\" \
-X \"github.com/docker/docker/dockerversion.BuildTime=${BUILDTIME}\" \
-X \"github.com/docker/docker/dockerversion.PlatformName=${PLATFORM}\" \
-X \"github.com/docker/docker/dockerversion.ProductName=${PRODUCT}\" \
-X \"github.com/docker/docker/dockerversion.DefaultProductLicense=${DEFAULT_PRODUCT_LICENSE}\" \
"
-X \"github.com/docker/docker/dockerversion.Version=${VERSION}\" \
-X \"github.com/docker/docker/dockerversion.GitCommit=${GITCOMMIT}\" \
-X \"github.com/docker/docker/dockerversion.BuildTime=${BUILDTIME}\" \
-X \"github.com/docker/docker/dockerversion.PlatformName=${PLATFORM}\" \
-X \"github.com/docker/docker/dockerversion.ProductName=${PRODUCT}\" \
-X \"github.com/docker/docker/dockerversion.DefaultProductLicense=${DEFAULT_PRODUCT_LICENSE}\" "

# Compile the Windows resources into the sources
if [ "$(go env GOOS)" = "windows" ]; then
Expand Down

0 comments on commit 699e853

Please sign in to comment.