diff --git a/.dockerignore b/.dockerignore index 4b186b4f..72c21b34 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ Dockerfile *.md bin -.idea \ No newline at end of file +.idea +dashboard/node_modules \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 839cfb38..79f451d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 76589070..e66ec334 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -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 }} diff --git a/Dockerfile b/Dockerfile index 434f61ad..a2ec85db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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