Skip to content

Commit 73359ad

Browse files
authored
Adding check for docker builx toolkit in Makefile to fix#1057 (#1083)
Signed-off-by: Soham Arora <[email protected]>
1 parent 48b2234 commit 73359ad

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Makefile

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ build_local_container:
114114
# Build and package a guac container for local testing
115115
# Separate build_container as its own target to ensure (workaround) goreleaser finish writing dist/artifacts.json
116116
.PHONY: container
117-
container: check-docker-tool-check check-goreleaser-tool-check build_local_container
117+
container: check-docker-tool-check check-docker-buildx-tool-check check-goreleaser-tool-check build_local_container
118118
# tag/name the image according to current docs to avoid changes
119119
@$(CONTAINER) tag \
120120
"$(shell cat dist/artifacts.json | jq --raw-output '.[] | select( .type =="Docker Image" ) | select( .goarch =="$(CPUTYPE)" ).name')" \
@@ -143,6 +143,14 @@ check-docker-tool-check:
143143
exit 1; \
144144
fi
145145

146+
# Check that docker buildx is installed.
147+
.PHONY: check-docker-buildx-tool-check
148+
check-docker-buildx-tool-check:
149+
@if ! command -v docker buildx >/dev/null 2>&1; then \
150+
echo "'$(CONTAINER)' builx is not installed. Please install '$(CONTAINER)' buildx and try again."; \
151+
exit 1; \
152+
fi
153+
146154
# Check that protoc is installed.
147155
.PHONY: check-protoc-tool-check
148156
check-protoc-tool-check:
@@ -176,4 +184,4 @@ check-goreleaser-tool-check:
176184

177185
# Check that all the tools are installed.
178186
.PHONY: check-tools
179-
check-tools: check-docker-tool-check check-protoc-tool-check check-golangci-lint-tool-check check-mockgen-tool-check check-goreleaser-tool-check
187+
check-tools: check-docker-tool-check check-docker-buildx-tool-check check-protoc-tool-check check-golangci-lint-tool-check check-mockgen-tool-check check-goreleaser-tool-check

0 commit comments

Comments
 (0)