Skip to content

Commit

Permalink
Second attempt to do multiarch image (#370)
Browse files Browse the repository at this point in the history
* Second attempt to do multiarch image

* Build it

* Arch Args

* Auth for push

* Remove condition

* Fix tag name

* Another try

* Finalize changes
  • Loading branch information
undera authored Jun 21, 2023
1 parent 27eb794 commit b61adf1
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Dockerfile
*.md
bin
.idea
.idea
dashboard/node_modules
23 changes: 22 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,33 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3

- name: Docker meta
uses: docker/metadata-action@v3
id: meta
with:
images: komodorio/helm-dashboard

- 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'
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_PASS }}

- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
outputs: local
push: ${{ github.event_name != 'pull_request' }}
tags: komodorio/helm-dashboard:unstable
labels: ${{ steps.meta.outputs.labels }}
build-args: VER=0.0.0-dev
platforms: linux/amd64,linux/arm64

helm_check:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v1
uses: docker/login-action@v2
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKERHUB_USER }}
Expand Down
16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
# Stage - builder
FROM golang as builder
FROM --platform=${BUILDPLATFORM:-linux/amd64} golang as builder

ARG TARGETPLATFORM
ARG BUILDPLATFORM
ARG TARGETOS
ARG TARGETARCH

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

WORKDIR /build
Expand All @@ -23,7 +27,11 @@ WORKDIR /build/src
RUN make build

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

ARG TARGETPLATFORM
ARG BUILDPLATFORM

EXPOSE 8080

# Python
Expand Down

0 comments on commit b61adf1

Please sign in to comment.