Skip to content

Commit

Permalink
ci: kcl arm64 image
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <xpf6677@163.com>
  • Loading branch information
Peefy committed May 11, 2024
1 parent 7a1fd7a commit 4de210f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,24 @@ jobs:
with:
go-version: 1.21

- name: Setup QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: v0.11.2
install: true

# <--- Login, build and push image to Docker Hub --->
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
Expand All @@ -35,6 +47,7 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM golang:1.21 AS build
FROM --platform=${BUILDPLATFORM} golang:1.21 AS build
COPY / /src
WORKDIR /src
RUN --mount=type=cache,target=/go/pkg --mount=type=cache,target=/root/.cache/go-build make build

FROM ubuntu:22.04 AS base
FROM --platform=${BUILDPLATFORM} ubuntu:22.04 AS base
ENV LANG=en_US.utf8

FROM base
Expand Down

0 comments on commit 4de210f

Please sign in to comment.