Skip to content

Commit

Permalink
Don't build an amd64 binary in the arm64 image
Browse files Browse the repository at this point in the history
Not entirely sure what's going on, but /function is definitely compiled
for amd64 inside an image that is otherwise arm64.

Signed-off-by: Nic Cope <[email protected]>
  • Loading branch information
negz committed Oct 23, 2023
1 parent 46f2fbc commit 1ec551e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ jobs:
target: image
build-args:
GO_VERSION=${{ env.GO_VERSION }}
outputs: type=docker,dest=runtime.tar
outputs: type=docker,dest=runtime-${{ matrix.arch }}.tar

- name: Setup the Crossplane CLI
run: "curl -sL https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh | sh"

- name: Build Package
run: ./crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime.tar
run: ./crossplane xpkg build --package-file=${{ matrix.arch }}.xpkg --package-root=package/ --embed-runtime-image-tarball=runtime-${{ matrix.arch }}.tar

- name: Upload Single-Platform Package
uses: actions/upload-artifact@v3
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

# We use the latest Go 1.x version unless asked to use something else.
ARG GO_VERSION=1
ARG TARGETOS
ARG TARGETARCH

# Setup the base environment.
FROM --platform=${BUILDPLATFORM} golang:${GO_VERSION} AS base
Expand All @@ -16,6 +14,8 @@ RUN --mount=type=cache,target=/go/pkg/mod go mod download

# Build the Function.
FROM base AS build
ARG TARGETOS
ARG TARGETARCH
RUN --mount=target=. \
--mount=type=cache,target=/go/pkg/mod \
--mount=type=cache,target=/root/.cache/go-build \
Expand Down

0 comments on commit 1ec551e

Please sign in to comment.