Skip to content

Commit

Permalink
Support ARM arch
Browse files Browse the repository at this point in the history
  • Loading branch information
rajashekhargundeti committed Jun 24, 2024
1 parent d76351a commit f170b4e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
11 changes: 4 additions & 7 deletions .github/workflows/build-n-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,11 @@ jobs:
uses: docker/setup-buildx-action@v2

- name: Log into GitHub Container Registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${GITHUB_ACTOR,,} --password-stdin
run: echo "${{ secrets.CR_PAT }}" | docker login ghcr.io -u ${GITHUB_ACTOR,,} --password-stdin

- name: Build Image
run: IMAGE_REGISTRY="${{ env.IMAGE_REGISTRY }}" make docker-build

- name: Push Image
run: IMAGE_REGISTRY="${{ env.IMAGE_REGISTRY }}" make docker-push
- name: Build and Push Image
run: IMAGE_REGISTRY="${{ env.IMAGE_REGISTRY }}" make docker-build-push

- name: Print Image Path
id: print-docker-image-path
run: echo IMAGE_PATH=`IMAGE_REGISTRY="${{ env.IMAGE_REGISTRY }}" make print-docker-image-path` >> $GITHUB_OUTPUT
run: echo IMAGE_PATH=`IMAGE_REGISTRY="${{ env.IMAGE_REGISTRY }}" make print-docker-image-path` >> $GITHUB_OUTPUT
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ build: cmd/server/main.go
go build -ldflags $(LDFLAGS) -mod vendor -o dist/provider ./cmd/server/main.go

docker-build:
docker build -t ${IMAGE_PATH} -f build/Dockerfile .
docker buildx build --platform=linux/amd64,linux/arm64 -t ${IMAGE_PATH} -f build/Dockerfile .
# docker buildx build --platform=linux/amd64 -t ${IMAGE_PATH} -f build/Dockerfile .

docker-push:
docker push ${IMAGE_PATH}

docker-build-push: docker-build
docker push ${IMAGE_PATH}
docker-build-push:
docker buildx build --push --platform=linux/amd64,linux/arm64 -t ${IMAGE_PATH} -f build/Dockerfile .

print-docker-image-path:
@echo ${IMAGE_PATH}

test-coverage:
go test -coverprofile=cover.out ./…
go tool cover -html=cover.out
go tool cover -html=cover.out

0 comments on commit f170b4e

Please sign in to comment.