Skip to content

Commit

Permalink
Fix multi-arch frontend build (#353)
Browse files Browse the repository at this point in the history
* Added --load flag to multi arch build

Signed-off-by: Maia Iyer <maia.raj.iyer@gmail.com>

* Use --push flag instead of --load

Signed-off-by: Maia Iyer <maia.raj.iyer@gmail.com>

* Add back old build and create new target for multiarch build

Signed-off-by: Maia Iyer <maia.raj.iyer@gmail.com>

* modified release frontend image target

Signed-off-by: Maia Iyer <maia.raj.iyer@gmail.com>

* removed erroneous tab

Signed-off-by: Maia Iyer <maia.raj.iyer@gmail.com>

---------

Signed-off-by: Maia Iyer <maia.raj.iyer@gmail.com>
  • Loading branch information
maia-iyer committed Mar 20, 2024
1 parent fee1687 commit 85d480d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/master-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
- name: Set release repo
run: echo "REPO=ghcr.io/${{ github.repository_owner }}" >> $GITHUB_ENV

# build and push images tagged with GITHUB_SHA, version, and latest
# build and push images tagged with GITHUB_SHA, version
- name: Build and push tornjak images
run: make release-images

Expand Down
26 changes: 19 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,7 @@ image-tornjak-manager: bin/tornjak-manager ## Build image for bin/tornjak-manage

.PHONY: image-tornjak-frontend
image-tornjak-frontend: ## Build image for tornjak-frontend
docker buildx create --platform $(PLATFORMS) --name multi-platform --node multi-platform0 --driver docker-container --use
docker buildx build --no-cache -f $(DOCKERFILE_FRONTEND) --build-arg version=$(VERSION) \
--platform $(PLATFORMS) \
docker build --no-cache -f $(DOCKERFILE_FRONTEND) --build-arg version=$(VERSION) \
--build-arg github_sha=$(GITHUB_SHA) -t $(CONTAINER_FRONTEND_TAG):$(IMAGE_TAG_PREFIX)$(VERSION) .

##@ Run:
Expand All @@ -122,8 +120,22 @@ release-tornjak-manager: image-tornjak-manager ## Release tornjak-manager image
docker tag $(CONTAINER_MANAGER_TAG):$(IMAGE_TAG_PREFIX)$(VERSION) $(CONTAINER_MANAGER_TAG):$(IMAGE_TAG_PREFIX)$(GITHUB_SHA)
docker push $(CONTAINER_MANAGER_TAG):$(IMAGE_TAG_PREFIX)$(GITHUB_SHA)

#.PHONY: release-tornjak-frontend
#release-tornjak-frontend: image-tornjak-frontend ## Release tornjak-frontend image
# docker push $(CONTAINER_FRONTEND_TAG):$(IMAGE_TAG_PREFIX)$(VERSION)
# docker tag $(CONTAINER_FRONTEND_TAG):$(IMAGE_TAG_PREFIX)$(VERSION) $(CONTAINER_FRONTEND_TAG):$(IMAGE_TAG_PREFIX)$(GITHUB_SHA)
# docker push $(CONTAINER_FRONTEND_TAG):$(IMAGE_TAG_PREFIX)$(GITHUB_SHA)


.PHONY: multiarch-container-builder
multiarch-container-builder:
docker buildx create --platform $(PLATFORMS) --name multi-platform --node multi-platform0 --driver docker-container --use


.PHONY: release-tornjak-frontend
release-tornjak-frontend: image-tornjak-frontend ## Release tornjak-frontend image
docker push $(CONTAINER_FRONTEND_TAG):$(IMAGE_TAG_PREFIX)$(VERSION)
docker tag $(CONTAINER_FRONTEND_TAG):$(IMAGE_TAG_PREFIX)$(VERSION) $(CONTAINER_FRONTEND_TAG):$(IMAGE_TAG_PREFIX)$(GITHUB_SHA)
docker push $(CONTAINER_FRONTEND_TAG):$(IMAGE_TAG_PREFIX)$(GITHUB_SHA)
release-tornjak-frontend: multiarch-container-builder
docker buildx build --no-cache -f $(DOCKERFILE_FRONTEND) --build-arg version=$(VERSION) \
--platform $(PLATFORMS) --push \
--build-arg github_sha=$(GITHUB_SHA) -t $(CONTAINER_FRONTEND_TAG):$(IMAGE_TAG_PREFIX)$(VERSION) -t $(CONTAINER_FRONTEND_TAG):$(IMAGE_TAG_PREFIX)$(GITHUB_SHA) .


0 comments on commit 85d480d

Please sign in to comment.