Skip to content

Commit 97b6ad8

Browse files
committed
add docker-buildx-plugin static package
Signed-off-by: CrazyMax <[email protected]>
1 parent 37aa0a7 commit 97b6ad8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

static/Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ include ../common.mk
22

33
CLI_DIR=$(realpath $(CURDIR)/../src/github.com/docker/cli)
44
ENGINE_DIR=$(realpath $(CURDIR)/../src/github.com/docker/docker)
5+
BUILDX_DIR=$(realpath $(CURDIR)/../src/github.com/docker/buildx)
6+
57
GEN_STATIC_VER=$(shell ./gen-static-ver $(CLI_DIR) $(VERSION))
68
HASH_CMD=docker run -v $(CURDIR):/sum -w /sum debian:jessie bash hash_files
79
DIR_TO_HASH:=build/linux
@@ -40,7 +42,7 @@ clean: ## remove build artifacts
4042
static: static-linux cross-mac cross-win cross-arm ## create all static packages
4143

4244
.PHONY: static-linux
43-
static-linux: static-cli static-engine ## create tgz with linux x86_64 client and server
45+
static-linux: static-cli static-engine static-buildx-plugin ## create tgz
4446
mkdir -p build/linux/docker
4547
cp $(CLI_DIR)/build/docker build/linux/docker/
4648
for f in dockerd containerd ctr containerd-shim containerd-shim-runc-v2 docker-init docker-proxy runc; do \
@@ -57,6 +59,9 @@ static-linux: static-cli static-engine ## create tgz with linux x86_64 client an
5759
done
5860
tar -C build/linux -c -z -f build/linux/docker-rootless-extras-$(GEN_STATIC_VER).tgz docker-rootless-extras
5961

62+
# buildx
63+
tar -C $(BUILDX_DIR)/bin -c -z -f build/linux/docker-buildx-plugin-$(DOCKER_BUILDX_REF:v%=%).tgz docker-buildx
64+
6065
.PHONY: hash_files
6166
hash_files:
6267
@echo "Hashing directory $(DIR_TO_HASH)"
@@ -100,6 +105,10 @@ static-cli:
100105
static-engine:
101106
$(MAKE) -C $(ENGINE_DIR) VERSION=$(GEN_STATIC_VER) DOCKER_BUILD_OPTS="$(DOCKER_BUILD_OPTS)" binary
102107

108+
.PHONY: static-buildx-plugin
109+
static-buildx-plugin:
110+
cd $(BUILDX_DIR) && docker buildx bake --set binaries.platform=$(TARGETPLATFORM) binaries && mv ./bin/buildx ./bin/docker-buildx
111+
103112
.PHONY: cross-all-cli
104113
cross-all-cli:
105114
$(MAKE) -C $(CLI_DIR) -f docker.Makefile VERSION=$(GEN_STATIC_VER) cross

0 commit comments

Comments
 (0)