Skip to content

Commit

Permalink
feat: added build arm32v6
Browse files Browse the repository at this point in the history
  • Loading branch information
OldTyT committed Feb 9, 2024
1 parent 6c71ddb commit ff00470
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 6 deletions.
37 changes: 34 additions & 3 deletions .github/workflows/github-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ on:


jobs:
build:
name: Build & Push
build_amd64:
name: "[amd64] Build & Push"
runs-on: ubuntu-latest
env:
REPOSITORY_URL: ghcr.io
Expand All @@ -25,7 +25,38 @@ jobs:
run: >-
docker build
-t $IMAGE_NAME
-t $REPOSITORY_URL/$IMAGE_NAME:latest .
-t $REPOSITORY_URL/$IMAGE_NAME:amd64-${{ steps.vars.outputs.SHORT_COMMIT_ID }}
-t $REPOSITORY_URL/$IMAGE_NAME:latest
-f docker/amd64/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_arm32v6:
name: "[arm32v6] 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 build
-t $IMAGE_NAME
-t $REPOSITORY_URL/$IMAGE_NAME:arm-${{ steps.vars.outputs.SHORT_COMMIT_ID }}
-t $REPOSITORY_URL/$IMAGE_NAME:arm
-f docker/arm32v6/Dockerfile .
- name: Docker Login
uses: docker/login-action@v3
with:
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile → docker/amd64/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ FROM golang:1.21.3-alpine3.18 AS builder
WORKDIR $GOPATH/frigate-telegram
COPY . $GOPATH/frigate-telegram

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

FROM alpine:3.18

Expand Down
16 changes: 16 additions & 0 deletions docker/arm32v6/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
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 .

FROM arm32v6/alpine:3.18

RUN apk --no-cache add tzdata

COPY --from=builder /go/frigate-telegram/frigate-telegram /frigate-telegram

USER 1000

ENTRYPOINT ["/frigate-telegram"]
16 changes: 16 additions & 0 deletions docker/arm32v7/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM arm32v7/golang:1.21.3-alpine3.18 AS builder

WORKDIR $GOPATH/frigate-telegram
COPY . $GOPATH/frigate-telegram

RUN go build .

FROM arm32v7/alpine:3.18

RUN apk --no-cache add tzdata

COPY --from=builder /go/frigate-telegram/frigate-telegram /frigate-telegram

USER 1000

ENTRYPOINT ["/frigate-telegram"]
16 changes: 16 additions & 0 deletions docker/arm64v8/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM arm64v8/golang:1.21.3-alpine3.18 AS builder

WORKDIR $GOPATH/frigate-telegram
COPY . $GOPATH/frigate-telegram

RUN go build .

FROM arm64v8/alpine:3.18

RUN apk --no-cache add tzdata

COPY --from=builder /go/frigate-telegram/frigate-telegram /frigate-telegram

USER 1000

ENTRYPOINT ["/frigate-telegram"]

0 comments on commit ff00470

Please sign in to comment.