File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6262 uses : docker/build-push-action@v2
6363 with :
6464 context : .
65+ platforms : linux/amd64,linux/arm64
6566 push : ${{ github.event_name != 'pull_request' }}
6667 tags : ${{ steps.meta.outputs.tags }}
6768 labels : ${{ steps.meta.outputs.labels }}
Original file line number Diff line number Diff line change 1- FROM golang:1.26 AS build
1+ FROM --platform=$BUILDPLATFORM golang:1.26 AS build
2+
3+ ARG TARGETOS
4+ ARG TARGETARCH
25
36WORKDIR /go/src/app
47COPY . .
58
6- RUN make
9+ RUN GOOS=$TARGETOS GOARCH=$TARGETARCH make
710
811FROM debian:bookworm-slim
912
Original file line number Diff line number Diff line change 1313 rm bin/site || :
1414
1515build :
16- go build -o bin/$(NAME ) \
16+ CGO_ENABLED=0 go build -o bin/$(NAME ) \
1717 -ldflags " -X '$( pkg) /pkg/version.Commit=$( git_commit) ' -X '$( pkg) /pkg/version.Date=$( date) ' -X '$( pkg) /pkg/version.Version=$( git_tag) '" \
1818 $(PACKAGE ) /cmd
1919
@@ -24,7 +24,7 @@ dev: build
2424 @bin/site
2525
2626docker :
27- docker build -t byxorna/site:$(git_tag ) .
27+ docker buildx build --platform linux/amd64,linux/arm64 -t byxorna/site:$(git_tag ) .
2828
2929pprof-heap : build
3030 go tool pprof http://localhost:6060/debug/pprof/heap
You can’t perform that action at this time.
0 commit comments