Skip to content

Commit

Permalink
Merge pull request #1730 from fluxcd/xx-build
Browse files Browse the repository at this point in the history
Optimize multi-arch build with XX
  • Loading branch information
stefanprodan authored Nov 26, 2024
2 parents ebf43ef + 0ef3567 commit 4d497b2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags/v')
with:
version: latest
args: release --release-notes=notes.md --clean --skip-validate
args: release --release-notes=notes.md --clean --skip=validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Generate SLSA metadata
Expand Down
12 changes: 10 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
FROM golang:1.23-alpine as builder
ARG GO_VERSION=1.23
ARG XX_VERSION=1.4.0

FROM --platform=$BUILDPLATFORM tonistiigi/xx:${XX_VERSION} AS xx
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-alpine as builder

Check warning on line 5 in Dockerfile

View workflow job for this annotation

GitHub Actions / release-flagger

The 'as' keyword should match the case of the 'from' keyword

FromAsCasing: 'as' and 'FROM' keywords' casing do not match More info: https://docs.docker.com/go/dockerfile/rule/from-as-casing/

# copy build utilities
COPY --from=xx / /

ARG TARGETPLATFORM
ARG REVISON
Expand All @@ -17,7 +24,8 @@ COPY cmd/ cmd/
COPY pkg/ pkg/

# build
RUN CGO_ENABLED=0 go build \
ENV CGO_ENABLED=0
RUN xx-go build \
-ldflags "-s -w -X github.com/fluxcd/flagger/pkg/version.REVISION=${REVISON}" \
-a -o flagger ./cmd/flagger

Expand Down

0 comments on commit 4d497b2

Please sign in to comment.