Skip to content

Commit

Permalink
feat: added build arm platform
Browse files Browse the repository at this point in the history
  • Loading branch information
OldTyT committed Feb 9, 2024
1 parent 192d9f3 commit c5181c5
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 5 deletions.
67 changes: 65 additions & 2 deletions .github/workflows/github-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ jobs:
- name: Build image
id: docker-build
run: >-
docker buildx create --platform linux/arm/v6 --name arm32v6 --use && \
docker buildx build
--platform linux/arm/v6
-t $IMAGE_NAME
-t $REPOSITORY_URL/$IMAGE_NAME:arm-${{ steps.vars.outputs.SHORT_COMMIT_ID }}
-t $REPOSITORY_URL/$IMAGE_NAME:arm
-t $REPOSITORY_URL/$IMAGE_NAME:arm32v6-${{ steps.vars.outputs.SHORT_COMMIT_ID }}
-t $REPOSITORY_URL/$IMAGE_NAME:arm32v6
-f docker/arm32v6/Dockerfile .
- name: Docker Login
uses: docker/login-action@v3
Expand All @@ -68,3 +69,65 @@ jobs:
- name: Publish Image
id: docker-push
run: docker push --all-tags $REPOSITORY_URL/$IMAGE_NAME
build_arm32v7:
name: "[arm32v7] Build & Push"
runs-on: ubuntu-latest
env:
REPOSITORY_URL: ghcr.io
IMAGE_NAME: oldtyt/frigate-telegram
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Variables
id: vars
run: echo "::set-output name=SHORT_COMMIT_ID::$(git rev-parse --short HEAD)"
- name: Build image
id: docker-build
run: >-
docker buildx create --platform linux/arm/v7 --name arm32v7 --use && \
docker buildx build
--platform linux/arm/v7
-t $IMAGE_NAME
-t $REPOSITORY_URL/$IMAGE_NAME:arm32v7-${{ steps.vars.outputs.SHORT_COMMIT_ID }}
-t $REPOSITORY_URL/$IMAGE_NAME:arm32v7
-f docker/arm32v7/Dockerfile .
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.REPOSITORY_URL }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Image
id: docker-push
run: docker push --all-tags $REPOSITORY_URL/$IMAGE_NAME
build_arm64v8:
name: "[arm64v7] Build & Push"
runs-on: ubuntu-latest
env:
REPOSITORY_URL: ghcr.io
IMAGE_NAME: oldtyt/frigate-telegram
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Variables
id: vars
run: echo "::set-output name=SHORT_COMMIT_ID::$(git rev-parse --short HEAD)"
- name: Build image
id: docker-build
run: >-
docker buildx create --platform linux/arm64/v8 --name arm64v8 --use && \
docker buildx build
--platform linux/arm64/v8
-t $IMAGE_NAME
-t $REPOSITORY_URL/$IMAGE_NAME:arm64v8-${{ steps.vars.outputs.SHORT_COMMIT_ID }}
-t $REPOSITORY_URL/$IMAGE_NAME:arm64v8
-f docker/arm64v8/Dockerfile .
- name: Docker Login
uses: docker/login-action@v3
with:
registry: ${{ env.REPOSITORY_URL }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish Image
id: docker-push
run: docker push --all-tags $REPOSITORY_URL/$IMAGE_NAME
4 changes: 3 additions & 1 deletion docker/arm32v6/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ FROM arm32v6/golang:1.21.3-alpine3.18 AS builder
WORKDIR $GOPATH/frigate-telegram
COPY . $GOPATH/frigate-telegram

RUN ls -la && exit 1&& go build .
RUN apk --no-cache add binutils && \
go build . && \
strip frigate-telegram

FROM arm32v6/alpine:3.18

Expand Down
4 changes: 3 additions & 1 deletion docker/arm32v7/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ FROM arm32v7/golang:1.21.3-alpine3.18 AS builder
WORKDIR $GOPATH/frigate-telegram
COPY . $GOPATH/frigate-telegram

RUN go build .
RUN apk --no-cache add binutils && \
go build . && \
strip frigate-telegram

FROM arm32v7/alpine:3.18

Expand Down
4 changes: 3 additions & 1 deletion docker/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ FROM arm64v8/golang:1.21.3-alpine3.18 AS builder
WORKDIR $GOPATH/frigate-telegram
COPY . $GOPATH/frigate-telegram

RUN go build .
RUN apk --no-cache add binutils && \
go build . && \
strip frigate-telegram

FROM arm64v8/alpine:3.18

Expand Down

0 comments on commit c5181c5

Please sign in to comment.