Skip to content

Commit

Permalink
Adding check for docker builx toolkit in Makefile to fix#1057 (#1083)
Browse files Browse the repository at this point in the history
Signed-off-by: Soham Arora <arorasoham9@gmail.com>
  • Loading branch information
arorasoham9 committed Jul 24, 2023
1 parent 48b2234 commit 73359ad
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Makefile
Expand Up @@ -114,7 +114,7 @@ build_local_container:
# Build and package a guac container for local testing
# Separate build_container as its own target to ensure (workaround) goreleaser finish writing dist/artifacts.json
.PHONY: container
container: check-docker-tool-check check-goreleaser-tool-check build_local_container
container: check-docker-tool-check check-docker-buildx-tool-check check-goreleaser-tool-check build_local_container
# tag/name the image according to current docs to avoid changes
@$(CONTAINER) tag \
"$(shell cat dist/artifacts.json | jq --raw-output '.[] | select( .type =="Docker Image" ) | select( .goarch =="$(CPUTYPE)" ).name')" \
Expand Down Expand Up @@ -143,6 +143,14 @@ check-docker-tool-check:
exit 1; \
fi

# Check that docker buildx is installed.
.PHONY: check-docker-buildx-tool-check
check-docker-buildx-tool-check:
@if ! command -v docker buildx >/dev/null 2>&1; then \
echo "'$(CONTAINER)' builx is not installed. Please install '$(CONTAINER)' buildx and try again."; \
exit 1; \
fi

# Check that protoc is installed.
.PHONY: check-protoc-tool-check
check-protoc-tool-check:
Expand Down Expand Up @@ -176,4 +184,4 @@ check-goreleaser-tool-check:

# Check that all the tools are installed.
.PHONY: check-tools
check-tools: check-docker-tool-check check-protoc-tool-check check-golangci-lint-tool-check check-mockgen-tool-check check-goreleaser-tool-check
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 comments on commit 73359ad

Please sign in to comment.