Skip to content

Commit

Permalink
add arm64 Docker build
Browse files Browse the repository at this point in the history
closes #2
  • Loading branch information
cdzombak committed May 25, 2024
1 parent 1c77fca commit 7ed7980
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 1 deletion.
31 changes: 30 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
with:
platforms: linux/arm64,linux/amd64
platforms: linux/arm64,linux/amd64,linux/arm64/v8

- name: Set up Docker Buildx
id: buildx
Expand Down Expand Up @@ -193,6 +193,35 @@ jobs:
build-args: |
BIN_VERSION=${{ needs.meta.outputs.bin_version }}
- name: "Meta: arm64"
id: docker_meta_arm64
uses: docker/metadata-action@v5
with:
images: |
${{ needs.meta.outputs.dockerhub_owner }}/${{ needs.meta.outputs.project_name }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
flavor: |
latest=false
suffix=-arm64
- name: "Build & Push: arm64"
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile-arm64
platforms: arm64v8
builder: ${{ steps.buildx.outputs.name }}
push: ${{ needs.meta.outputs.is_pull_request != 'true' }}
tags: ${{ steps.docker_meta_arm64.outputs.tags }}
labels: ${{ steps.docker_meta_arm64.outputs.labels }}
build-args: |
BIN_VERSION=${{ needs.meta.outputs.bin_version }}
- name: Update Docker Hub description
if: needs.meta.outputs.is_release == 'true'
uses: peter-evans/dockerhub-description@v3
Expand Down
31 changes: 31 additions & 0 deletions Dockerfile-arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# for arm64/aarch64
# see: https://github.com/ultralytics/ultralytics/blob/main/docker/Dockerfile-arm64

FROM arm64v8/python:3-bookworm
ARG BIN_VERSION=<unknown>

RUN apt-get -y update \
&& apt-get install --no-install-recommends -y \
curl git zip libpython3-dev python3-opencv libgl1 libglib2.0-0 gnupg g++ libusb-1.0-0 \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir /app
COPY ./*.py ./requirements.txt /app/
RUN pip install --no-cache-dir -r /app/requirements.txt

WORKDIR /app
RUN curl -f -L -O https://github.com/ultralytics/assets/releases/download/v8.2.0/yolov8n.pt
ENV DM_DOCKER_ALSO_BIND="*:2856"
HEALTHCHECK CMD curl -s --max-time 2 --fail http://localhost:2856/health || exit 1
ENTRYPOINT ["python3", "main.py"]

LABEL license="GPL-3.0"
LABEL maintainer="Chris Dzombak <https://www.dzombak.com>"
LABEL org.opencontainers.image.authors="Chris Dzombak <https://www.dzombak.com>"
LABEL org.opencontainers.image.url="https://github.com/cdzombak/driveway-monitor"
LABEL org.opencontainers.image.documentation="https://github.com/cdzombak/driveway-monitor/blob/main/README.md"
LABEL org.opencontainers.image.source="https://github.com/cdzombak/driveway-monitor.git"
LABEL org.opencontainers.image.version="${BIN_VERSION}"
LABEL org.opencontainers.image.licenses="GPL-3.0"
LABEL org.opencontainers.image.title="driveway-monitor"
LABEL org.opencontainers.image.description="Receive customizable, AI-powered notifications when someone arrives in your driveway."

0 comments on commit 7ed7980

Please sign in to comment.