Skip to content

Commit

Permalink
Use buildx to push latest image tag from main
Browse files Browse the repository at this point in the history
  • Loading branch information
ishustava committed Jul 20, 2022
1 parent bce8f29 commit c430a68
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions control-plane/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,14 @@ ci.dev-docker:
$(CI_DEV_DOCKER_WORKDIR) -f $(CURDIR)/Dockerfile
@echo "Pushed dev image to: $(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):$(GIT_COMMIT)"
ifeq ($(CIRCLE_BRANCH), main)
@docker tag $(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):$(GIT_COMMIT) $(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):latest
@docker push $(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):latest
@docker buildx build -t '$(CI_DEV_DOCKER_NAMESPACE)/$(CI_DEV_DOCKER_IMAGE_NAME):latest' \
--platform linux/amd64,linux/arm64 \
--target=dev \
--push \
--label COMMIT_SHA=$(CIRCLE_SHA1) \
--label PULL_REQUEST=$(CIRCLE_PULL_REQUEST) \
--label CIRCLE_BUILD_URL=$(CIRCLE_BUILD_URL) \
$(CI_DEV_DOCKER_WORKDIR) -f $(CURDIR)/Dockerfile
endif

# In Github Actions, the linux binary will be attached from a previous step at pkg/bin/linux_amd64/. This make target
Expand Down

0 comments on commit c430a68

Please sign in to comment.