File tree Expand file tree Collapse file tree 4 files changed +20
-2
lines changed Expand file tree Collapse file tree 4 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ GO_IMAGE?=$(GO_BASE_IMAGE):$(GO_VERSION)-buster
99GEN_DEB_VER =$(shell ./gen-deb-ver $(realpath $(CURDIR ) /../src/github.com/docker/cli) "$(VERSION ) ")
1010EPOCH? =5
1111SCAN_GITCOMMIT? =$(shell cd $(realpath $(CURDIR ) /../src/github.com/docker/scan-cli-plugin) && git rev-parse --short HEAD)
12+ BUILDX_GITCOMMIT? =$(shell cd $(realpath $(CURDIR ) /../src/github.com/docker/buildx) && git rev-parse --short HEAD)
1213
1314ifdef BUILD_IMAGE
1415 BUILD_IMAGE_FLAG=--build-arg $(BUILD_IMAGE)
@@ -34,6 +35,7 @@ RUN?=docker run --rm \
3435 -e CLI_GITCOMMIT=$(CLI_GITCOMMIT ) \
3536 -e ENGINE_GITCOMMIT=$(ENGINE_GITCOMMIT ) \
3637 -e BUILDX_VERSION=$(DOCKER_BUILDX_REF ) \
38+ -e BUILDX_GITCOMMIT=$(BUILDX_GITCOMMIT ) \
3739 -e COMPOSE_VERSION=$(DOCKER_COMPOSE_REF ) \
3840 -e SCAN_VERSION=$(DOCKER_SCAN_REF ) \
3941 -e SCAN_GITCOMMIT=$(SCAN_GITCOMMIT ) \
Original file line number Diff line number Diff line change @@ -19,7 +19,14 @@ override_dh_auto_build:
1919 # Build buildx plugin
2020 cd /go/src/github.com/docker/buildx \
2121 && mkdir -p /usr/libexec/docker/cli-plugins/ \
22- && CGO_ENABLED=0 GO111MODULE=on go build -mod=vendor -o /usr/libexec/docker/cli-plugins/docker-buildx -ldflags "-X github.com/docker/buildx/version.Version=$(BUILDX_VERSION) -X github.com/docker/buildx/version.Revision=$(git rev-parse HEAD) -X github.com/docker/buildx/version.Package=github.com/docker/buildx" ./cmd/buildx
22+ && GO111MODULE=on \
23+ CGO_ENABLED=0 \
24+ go build \
25+ -mod=vendor \
26+ -trimpath \
27+ -ldflags "-X github.com/docker/buildx/version.Version=$(BUILDX_VERSION) -X github.com/docker/buildx/version.Revision=$(BUILDX_GITCOMMIT) -X github.com/docker/buildx/version.Package=github.com/docker/buildx" \
28+ -o "/usr/libexec/docker/cli-plugins/docker-buildx" \
29+ ./cmd/buildx
2330
2431 # Build the compose plugin
2532 cd /go/src/github.com/docker/compose \
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ GEN_SCAN_RPM_VER=$(shell ./gen-rpm-ver $(realpath $(CURDIR)/../src/github.com/do
1010CLI_GITCOMMIT? =$(shell cd $(realpath $(CURDIR ) /../src/github.com/docker/cli) && git rev-parse --short HEAD)
1111ENGINE_GITCOMMIT? =$(shell cd $(realpath $(CURDIR ) /../src/github.com/docker/docker) && git rev-parse --short HEAD)
1212SCAN_GITCOMMIT? =$(shell cd $(realpath $(CURDIR ) /../src/github.com/docker/scan-cli-plugin) && git rev-parse --short HEAD)
13+ BUILDX_GITCOMMIT? =$(shell cd $(realpath $(CURDIR ) /../src/github.com/docker/buildx) && git rev-parse --short HEAD)
1314
1415ifdef BUILD_IMAGE
1516 BUILD_IMAGE_FLAG=--build-arg $(BUILD_IMAGE)
@@ -38,6 +39,7 @@ RPMBUILD_FLAGS?=-ba\
3839 --define '_origversion $(word 4, $(GEN_RPM_VER ) ) ' \
3940 --define '_buildx_rpm_version $(word 1,$(GEN_BUILDX_RPM_VER ) ) ' \
4041 --define '_buildx_version $(word 4,$(GEN_BUILDX_RPM_VER ) ) ' \
42+ --define '_buildx_gitcommit $(BUILDX_GITCOMMIT ) ' \
4143 --define '_compose_rpm_version $(word 1,$(GEN_COMPOSE_RPM_VER ) ) ' \
4244 --define '_compose_version $(word 4,$(GEN_COMPOSE_RPM_VER ) ) ' \
4345 --define '_scan_rpm_version $(word 1,$(GEN_SCAN_RPM_VER ) ) ' \
Original file line number Diff line number Diff line change @@ -22,7 +22,14 @@ Docker Buildx plugin for the Docker CLI.
2222
2323%build
2424pushd ${RPM_BUILD_DIR} /src/buildx
25- bash -c ' CGO_ENABLED=0 GO111MODULE=on go build -mod=vendor -o bin/docker-buildx -ldflags "-X github.com/docker/buildx/version.Version=%{_buildx_version} -X github.com/docker/buildx/version.Revision=%{_buildx_gitcommit} -X github.com/docker/buildx/version.Package=github.com/docker/buildx" ./cmd/buildx'
25+ GO111MODULE=on \
26+ CGO_ENABLED=0 \
27+ go build \
28+ -mod=vendor \
29+ -trimpath \
30+ -ldflags=" -X github.com/docker/buildx/version.Version=%{_buildx_version} -X github.com/docker/buildx/version.Revision=%{_buildx_gitcommit} -X github.com/docker/buildx/version.Package=github.com/docker/buildx" \
31+ -o " bin/docker-buildx" \
32+ ./cmd/buildx
2633popd
2734
2835%check
You can’t perform that action at this time.
0 commit comments