Skip to content

Commit

Permalink
Add support for Multi arch image (Frontend) (#347)
Browse files Browse the repository at this point in the history
* multi arch image support arm64 added including ci build

Signed-off-by: Mohammed Abdi <moabdi@Mohammeds-MBP.attlocal.net>

* update qemu and buildx to v3

Signed-off-by: Mohammed Abdi <moabdi@Mohammeds-MBP.attlocal.net>

* add to label

Signed-off-by: Mohammed Abdi <moabdi@Mohammeds-MBP.attlocal.net>

* update label format

Signed-off-by: Mohammed Abdi <moabdi@Mohammeds-MBP.attlocal.net>

---------

Signed-off-by: Mohammed Abdi <moabdi@Mohammeds-MBP.attlocal.net>
Co-authored-by: Mohammed Abdi <moabdi@Mohammeds-MBP.attlocal.net>
  • Loading branch information
mamy-CS and Mohammed Abdi authored Feb 23, 2024
1 parent 0e56df2 commit 33c67eb
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ jobs:
with:
node-version: '18'

# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Download modules
run: go mod download

Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/master-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,13 @@ jobs:
with:
node-version: '18'

# https://github.com/docker/setup-qemu-action
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
# https://github.com/docker/setup-buildx-action
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Download modules
run: go mod download

Expand Down
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ GO_VERSION ?= 1.20

GO_FILES := $(shell find . -type f -name '*.go' -not -name '*_test.go' -not -path './vendor/*')

## multiarch images
PLATFORMS ?= linux/amd64,linux/arm64

all: binaries images ## Builds both binaries and images (default task)

.PHONY: help
Expand Down Expand Up @@ -90,7 +93,9 @@ 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 build --no-cache -f $(DOCKERFILE_FRONTEND) --build-arg version=$(VERSION) \
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) \
--build-arg github_sha=$(GITHUB_SHA) -t $(CONTAINER_FRONTEND_TAG):$(IMAGE_TAG_PREFIX)$(VERSION) .

##@ Run:
Expand Down
2 changes: 1 addition & 1 deletion frontend/Dockerfile.frontend-container
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ LABEL org.opencontainers.image.description="Tornjak frontend ($version) Alpine b
org.opencontainers.image.source="https://github.com/spiffe/tornjak" \
org.opencontainers.image.documentation="https://github.com/spiffe/tornjak/tree/main/docs"
# additional labels
LABEL architecture="amd64" \
LABEL architecture="amd64,arm64" \
build-date="" \
description="Tornjak Frontend" \
io.k8s.description="Tornjak Frontend" \
Expand Down

0 comments on commit 33c67eb

Please sign in to comment.