Skip to content

Commit

Permalink
Use docker buildx for multi-platform builds
Browse files Browse the repository at this point in the history
The 'docker build' command does not support more than one platform at
a time.

Signed-off-by: James Alseth <james@jalseth.me>
  • Loading branch information
jalseth committed Mar 24, 2023
1 parent 96c44d3 commit 0e6576a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,6 @@ examples: ## Builds the examples Docker image.
.PHONY: push
push: ## Pushes the examples and Conftest image to DockerHub. Requires `TAG` parameter.
@test -n "$(TAG)" || (echo "TAG parameter not set." && exit 1)
@$(DOCKER) build . --build-arg VERSION="$(TAG)" -t $(IMAGE):$(TAG) --platform $(DOCKER_PLATFORMS)
@$(DOCKER) build . --target examples -t $(IMAGE):examples
@$(DOCKER) tag $(IMAGE):$(TAG) $(IMAGE):latest
@$(DOCKER) push $(IMAGE):$(TAG)
@$(DOCKER) push $(IMAGE):latest
@$(DOCKER) push $(IMAGE):examples
@$(DOCKER) buildx build . --push --build-arg VERSION="$(TAG)" -t $(IMAGE):$(TAG) --platform $(DOCKER_PLATFORMS)
@$(DOCKER) buildx build . --push --build-arg VERSION="$(TAG)" -t $(IMAGE):latest --platform $(DOCKER_PLATFORMS)
@$(DOCKER) buildx build . --push --target examples -t $(IMAGE):examples --platform $(DOCKER_PLATFORMS)

0 comments on commit 0e6576a

Please sign in to comment.