diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0eddae68..12fc26f3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,7 +10,7 @@ jobs: steps: # checkout repo - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 # setup multi-arch build support - name: Install Dependencies @@ -22,25 +22,25 @@ jobs: - name: Get Branch / Tag Name id: get_branch run: | - export RELEASE_NAME=$(if [[ ${GITHUB_REF} =~ "refs/tags/" ]]; then echo ${GITHUB_REF/refs\/tags\//}; else echo ${GITHUB_REF/refs\/heads\//}; fi) - echo $RELEASE_NAME - echo ::set-output name=NAME::${RELEASE_NAME} + export BRANCH_NAME=$(if [[ ${GITHUB_REF} =~ "refs/tags/" ]]; then echo ${GITHUB_REF/refs\/tags\//}; else echo ${GITHUB_REF/refs\/heads\//}; fi) + echo $BRANCH_NAME + echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT # generate the image tag - name: Get Image Tag id: get_tag run: | - export TARGET_IMAGE_TAG=$(if [ "${{ steps.get_branch.outputs.NAME }}" = "latest" ]; then echo "latest"; else echo "${{ steps.get_branch.outputs.NAME }}"; fi) + export TARGET_IMAGE_TAG=$(if [ "${{ steps.get_branch.outputs.NAME }}" = "latest" ]; then echo "latest"; else echo "${{ steps.get_branch.outputs.BRANCH_NAME }}"; fi) echo $TARGET_IMAGE_TAG - echo ::set-output name=NAME::${TARGET_IMAGE_TAG} + echo "TARGET_IMAGE_TAG=${TARGET_IMAGE_TAG}" >> $GITHUB_OUTPUT # generate the alternative image tag - name: Get Alternate Tag id: get_alt_tag run: | - export ALT_IMAGE_TAG=$(if [ "${{ steps.get_branch.outputs.NAME }}" = "latest" ]; then echo "ubuntu"; else echo "${{ steps.get_branch.outputs.NAME }}-ubuntu"; fi) + export ALT_IMAGE_TAG=$(if [ "${{ steps.get_branch.outputs.NAME }}" = "latest" ]; then echo "ubuntu"; else echo "${{ steps.get_branch.outputs.BRANCH_NAME }}-ubuntu"; fi) echo $ALT_IMAGE_TAG - echo ::set-output name=NAME::${ALT_IMAGE_TAG} + echo "ALT_IMAGE_TAG=${ALT_IMAGE_TAG}" >> $GITHUB_OUTPUT # login to docker hub - name: Login to Docker Hub @@ -50,7 +50,7 @@ jobs: # login to github container registry - name: Login to Packages Container registry - uses: docker/login-action@v1 + uses: docker/login-action@v3 if: github.repository == 'homebridge/docker-homebridge' with: registry: ghcr.io @@ -66,11 +66,11 @@ jobs: # build the image for Docker Hub - name: Build Image For Docker Hub run: | - docker buildx build --push -f Dockerfile --platform linux/amd64,linux/arm/v7,linux/arm64 -t homebridge/homebridge:${{ steps.get_alt_tag.outputs.NAME }} . - docker buildx build --push -f Dockerfile --platform linux/amd64,linux/arm/v7,linux/arm64 -t homebridge/homebridge:${{ steps.get_tag.outputs.NAME }} . + docker buildx build --push -f Dockerfile --platform linux/amd64,linux/arm/v7,linux/arm64 -t homebridge/homebridge:${{ steps.get_alt_tag.outputs.ALT_IMAGE_TAG }} . + docker buildx build --push -f Dockerfile --platform linux/amd64,linux/arm/v7,linux/arm64 -t homebridge/homebridge:${{ steps.get_tag.outputs.TARGET_IMAGE_TAG }} . # build the image for Github Container Registry (will use the cached build from the previous step) - name: Build Image For Github Container Registry run: | - docker buildx build --push -f Dockerfile --platform linux/amd64,linux/arm/v7,linux/arm64 -t ghcr.io/homebridge/homebridge:${{ steps.get_alt_tag.outputs.NAME }} . - docker buildx build --push -f Dockerfile --platform linux/amd64,linux/arm/v7,linux/arm64 -t ghcr.io/homebridge/homebridge:${{ steps.get_tag.outputs.NAME }} . + docker buildx build --push -f Dockerfile --platform linux/amd64,linux/arm/v7,linux/arm64 -t ghcr.io/homebridge/homebridge:${{ steps.get_alt_tag.outputs.ALT_IMAGE_TAG }} . + docker buildx build --push -f Dockerfile --platform linux/amd64,linux/arm/v7,linux/arm64 -t ghcr.io/homebridge/homebridge:${{ steps.get_tag.outputs.TARGET_IMAGE_TAG }} . diff --git a/Dockerfile b/Dockerfile index 0edbf176..4479b85f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,8 +8,8 @@ LABEL org.opencontainers.image.licenses="GPL-3.0" # update to latest releases prior to release -ENV HOMEBRIDGE_PKG_VERSION=1.0.34 \ - FFMPEG_VERSION=v0.1.0 +ENV HOMEBRIDGE_PKG_VERSION=1.1.3 \ + FFMPEG_VERSION=v2.1.1 ENV S6_OVERLAY_VERSION=3.1.1.2 \ S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0 \ @@ -51,12 +51,12 @@ RUN case "$(uname -m)" in \ RUN case "$(uname -m)" in \ x86_64) FFMPEG_ARCH='x86_64';; \ - armv7l) FFMPEG_ARCH='armv7l';; \ + armv7l) FFMPEG_ARCH='arm32v7';; \ aarch64) FFMPEG_ARCH='aarch64';; \ *) echo "unsupported architecture"; exit 1 ;; \ esac \ && set -x \ - && curl -Lfs https://github.com/homebridge/ffmpeg-for-homebridge/releases/download/${FFMPEG_VERSION}/ffmpeg-debian-${FFMPEG_ARCH}.tar.gz | tar xzf - -C / --no-same-owner + && curl -Lfs https://github.com/homebridge/ffmpeg-for-homebridge/releases/download/${FFMPEG_VERSION}/ffmpeg-alpine-${FFMPEG_ARCH}.tar.gz | tar xzf - -C / --no-same-owner RUN case "$(uname -m)" in \ x86_64) DEB_ARCH='amd64';; \ diff --git a/README.md b/README.md index 1a7c41c7..0cabb9af 100644 --- a/README.md +++ b/README.md @@ -32,13 +32,9 @@ Homebridge requires full access to your local network to function correctly whic ## Usage -Command Line: +### Using [Docker Compose](https://docs.docker.com/compose/) (recommended): -```bash -docker run --net=host --name=homebridge -v $(pwd)/homebridge:/homebridge homebridge/homebridge:latest -``` - -Using [Docker Compose](https://docs.docker.com/compose/) (recommended): +1. Create the file `docker-compose.yml` ```yml version: '2' @@ -52,8 +48,26 @@ services: logging: driver: json-file options: - max-size: "10mb" - max-file: "1" + max-size: '10m' + max-file: '1' + healthcheck: + test: curl --fail localhost:8581 || exit 1 + interval: 60s + retries: 5 + start_period: 300s + timeout: 2s +``` + +2. Start docker with + +```bash +docker compose up +``` + +### Or Command Line: + +```bash +docker run --net=host --name=homebridge -v $(pwd)/homebridge:/homebridge homebridge/homebridge:latest ``` ## Parameters