Skip to content

Commit

Permalink
Merge pull request #7 from ClickHouse/native-xcompile
Browse files Browse the repository at this point in the history
fix build & remove qemu
  • Loading branch information
tommyzli authored May 15, 2024
2 parents c3be42a + 5225b25 commit 6babbba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
- name: Check out the repo
uses: actions/checkout@v3

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

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

Expand Down Expand Up @@ -58,7 +55,7 @@ jobs:
- name: Log in to EU registry
uses: docker/login-action@v2
with:
registry: eu-docker.pkg.dev
registry: europe-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.login-gcp.outputs.access_token }}

Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
FROM golang:1.20 AS builder
FROM --platform=$BUILDPLATFORM golang:1.20 AS builder

ARG VERSION
ENV PKG github.com/resmoio/kubernetes-event-exporter/pkg
ARG TARGETOS TARGETARCH

ADD . /app
WORKDIR /app
RUN CGO_ENABLED=0 GOOS=linux GO11MODULE=on go build -ldflags="-s -w -X ${PKG}/version.Version=${VERSION}" -a -o /main .
RUN CGO_ENABLED=0 GOOS=${TARGETOS} GOARCH=${TARGETARCH} GO11MODULE=on go build -ldflags="-s -w -X ${PKG}/version.Version=${VERSION}" -a -o /main .

FROM gcr.io/distroless/static:nonroot
COPY --from=builder --chown=nonroot:nonroot /main /kubernetes-event-exporter
Expand Down

0 comments on commit 6babbba

Please sign in to comment.