Skip to content

Commit

Permalink
Merge pull request #454 from alphagov/dj-maisy/router_arm_builds
Browse files Browse the repository at this point in the history
Get multi-arch builds for Router.
  • Loading branch information
dj-maisy authored May 3, 2024
2 parents 0bb4d62 + 0ecc80c commit d4c9710
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
build-and-publish-image:
if: github.event_name == 'workflow_dispatch' || startsWith(github.event.release.tag_name, 'v')
name: Build and publish image
uses: alphagov/govuk-infrastructure/.github/workflows/build-and-push-image.yml@main
uses: alphagov/govuk-infrastructure/.github/workflows/build-and-push-multiarch-image.yml@main
with:
gitRef: ${{ inputs.gitRef || github.event.release.tag_name }}
permissions:
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG go_registry=""
ARG go_version=1.22
ARG go_tag_suffix=-alpine

FROM ${go_registry}golang:${go_version}${go_tag_suffix} AS builder
FROM --platform=$TARGETPLATFORM ${go_registry}golang:${go_version}${go_tag_suffix} AS builder
ARG TARGETARCH TARGETOS
ARG GOARCH=$TARGETARCH GOOS=$TARGETOS
ARG CGO_ENABLED=0
Expand All @@ -18,7 +18,7 @@ RUN go build -ldflags="$go_ldflags" && \
./router -version && \
go version -m ./router

FROM scratch
FROM --platform=$TARGETPLATFORM scratch
COPY --from=builder /src/router /bin/router
COPY --from=builder /usr/share/ca-certificates /usr/share/ca-certificates
COPY --from=builder /etc/ssl /etc/ssl
Expand Down

0 comments on commit d4c9710

Please sign in to comment.