Skip to content

Commit

Permalink
Add arm64 image building (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
undera authored Jul 30, 2023
1 parent 9ca8a8c commit 9a7cd08
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ jobs:
with:
images: komodorio/komoplane

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
Expand All @@ -86,6 +91,7 @@ jobs:
tags: komodorio/komoplane:unstable
labels: ${{ steps.meta.outputs.labels }}
build-args: VER=0.0.0-dev
platforms: linux/amd64,linux/arm64

static:
runs-on: ubuntu-latest
Expand Down
11 changes: 9 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:

image:
runs-on: ubuntu-latest
needs: [release, pre_release]
needs: [ release, pre_release ]
timeout-minutes: 60
steps:
- name: Check out the repo
Expand All @@ -71,6 +71,11 @@ jobs:
with:
images: komodorio/komoplane

- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
Expand All @@ -87,10 +92,12 @@ jobs:
tags: komodorio/komoplane:${{ needs.pre_release.outputs.release_tag }},komodorio/komoplane:latest
labels: ${{ steps.meta.outputs.labels }}
build-args: VER=${{ needs.pre_release.outputs.release_tag }}
platforms: linux/amd64,linux/arm64


publish_chart:
runs-on: ubuntu-latest
needs: [image, pre_release]
needs: [ image, pre_release ]
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
steps:
- name: Checkout
Expand Down
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ WORKDIR /build/pkg/frontend
RUN npm i && npm run build

# Stage - builder
FROM golang as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang as builder

ENV GOOS=linux
ENV GOARCH=amd64
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH

ENV GOOS=${TARGETOS:-linux}
ENV GOARCH=${TARGETARCH:-amd64}
ENV CGO_ENABLED=0

WORKDIR /build
Expand All @@ -36,7 +41,10 @@ ADD ./pkg/frontend/fs.go ./pkg/frontend
RUN make build_go

# Stage - runner
FROM alpine
FROM --platform=${TARGETPLATFORM:-linux/amd64} alpine

ARG TARGETPLATFORM
ARG BUILDPLATFORM

EXPOSE 8090

Expand Down

0 comments on commit 9a7cd08

Please sign in to comment.