buildx
buildx copied to clipboard
hack: use single output dir
reduce footprint in our gitignore by using a single output dir for build, cross and coverage. also remove unused cross-out. structure will look like this:
-
./bin/build -
./bin/coverage -
./bin/release
can be overridden using the DESTDIR env var. name of this en var seems to be the more approriate in our case: https://www.gnu.org/prep/standards/html_node/DESTDIR.html.
also mutualize local and Dockerfile build opts so we avoid drifting with packaging releases in https://github.com/docker/docker-ce-packaging/blob/43635c4329d15c3639d6b8693b653b7ea9818487/deb/common/rules#L22:
we can then change:
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
with:
DESTDIR=/usr/libexec/docker/cli-plugins VERSION=$(BUILDX_VERSION) REVISION=$(BUILDX_GITCOMMIT) make build
Signed-off-by: CrazyMax [email protected]