Skip to content

Commit

Permalink
Merge pull request #319 from isometry/feature/arm64-compat
Browse files Browse the repository at this point in the history
feat: linux/arm64 compatibility
  • Loading branch information
cert-manager-prow[bot] authored Jun 27, 2024
2 parents 3907641 + f1a5fd0 commit 9c5d2e0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/on-push-to-main-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ jobs:
build-args: |
pkg_version=${{ env.PLUGIN_VERSION }}
context: .
platforms: linux/amd64,linux/arm64
tags: |
${{ env.TAG_BASE }}:latest
${{ env.TAG_BASE }}:${{ env.PLUGIN_VERSION }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
build-args: |
pkg_version=${{ steps.tag.outputs.tag }}
context: .
platforms: linux/amd64,linux/arm64
tags: |
${{ env.TAG_BASE }}:latest
${{ env.TAG_BASE }}:${{steps.tag.outputs.tag}}
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Build the manager binary
FROM golang:1.22 as builder
FROM --platform=${BUILDPLATFORM} golang:1.22 as builder
WORKDIR /workspace

ARG TARGETARCH=amd64
ARG TARGETOS=linux
ARG TARGETARCH
ARG TARGETOS

ENV GOPROXY=direct
# Copy the Go Modules manifests
Expand All @@ -18,8 +18,8 @@ COPY main.go main.go
COPY pkg/ pkg/

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

# Do an initial compilation before setting the version so that there is less to
Expand All @@ -38,7 +38,7 @@ RUN VERSION=$pkg_version && \

# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot
FROM --platform=${TARGETPLATFORM:-linux/amd64} gcr.io/distroless/static:nonroot
LABEL org.opencontainers.image.authors="Jochen Ullrich <kontakt@ju-hh.de>"
LABEL org.opencontainers.image.source=https://github.com/cert-manager/aws-privateca-issuer
WORKDIR /
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ docker-build: test
--build-arg pkg_version=${VERSION} \
--tag ${IMG} \
--file Dockerfile \
--platform=linux/amd64,linux/arm64 \
${CURDIR}

# Push the docker image
Expand Down

0 comments on commit 9c5d2e0

Please sign in to comment.