diff --git a/.github/workflows/docker-build.yaml b/.github/workflows/docker-build.yaml index 355d71b0..772586e1 100644 --- a/.github/workflows/docker-build.yaml +++ b/.github/workflows/docker-build.yaml @@ -13,8 +13,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v2 - - name: Set branch env. - run: echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV + - name: Set SHAIRPORT_SYNC_BRANCH env. + run: echo "SHAIRPORT_SYNC_BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV - name: Set up ssh agent uses: webfactory/ssh-agent@v0.5.2 # Can be removed when no longer pulling from private repos. with: @@ -36,7 +36,7 @@ jobs: file: ./docker/Dockerfile platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm64,linux/arm/v7 push: true - tags: registry.nova.do/shairport-sync:unstable-${{ env.BRANCH }} + tags: registry.nova.do/shairport-sync:unstable-${{ env.SHAIRPORT_SYNC_BRANCH }} build-args: | - BRANCH=${{ env.BRANCH }} + SHAIRPORT_SYNC_BRANCH=${{ env.SHAIRPORT_SYNC_BRANCH }} ssh: github=${{ env.SSH_AUTH_SOCK }} # Can be removed when no longer pulling from private repos. \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index 1f9f0ca2..d7df1481 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -42,8 +42,10 @@ RUN make install # Shairport Sync Build System: FROM builder-base AS builder-sps -# This may be modified by the Github Action Workflow. -ARG SHAIRPORT_SYNC_BRANCH=development +# This will be modified by the Github Action Workflow and is required +# to ensure the correct branch is being used. +ARG SHAIRPORT_SYNC_BRANCH +RUN test -n "$SHAIRPORT_SYNC_BRANCH" COPY --from=builder-alac /usr/local/lib/libalac.* /usr/local/lib/ COPY --from=builder-alac /usr/local/lib/pkgconfig/alac.pc /usr/local/lib/pkgconfig/alac.pc @@ -62,12 +64,12 @@ RUN make RUN make install WORKDIR / -RUN --mount=type=ssh,id=github git clone git@github.com:aillwee/shairport-sync.git WORKDIR /shairport-sync -RUN git checkout "$SHAIRPORT_SYNC_BRANCH" -RUN autoreconf -fi +COPY . . +RUN git checkout $SHAIRPORT_SYNC_BRANCH RUN git submodule init RUN git submodule update +RUN autoreconf -fi # RUN ./configure \ # --with-alsa \ # --with-dummy \ @@ -128,7 +130,6 @@ RUN adduser -D shairport-sync -G shairport-sync # Add the shairport-sync user to the pre-existing audio group, which has ID 29, for access to the ALSA stuff RUN addgroup -g 29 docker_audio && addgroup shairport-sync docker_audio && addgroup shairport-sync audio -COPY ./docker/shairport-sync.conf /etc/shairport-sync.conf COPY ./docker/start.sh / RUN chmod +x ./start.sh diff --git a/docker/README.md b/docker/README.md index 74b986ca..4e10daae 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,3 +1,12 @@ # Shairport Sync Docker Image -https://hub.docker.com/r/mikebrady/shairport-sync \ No newline at end of file +Available at: https://hub.docker.com/r/mikebrady/shairport-sync + +## Build Example (for arm7 devices) + +TODO: remove `--ssh` when going public as this is only for private repos. +``` +docker buildx build --ssh github=$SSH_AUTH_SOCK --platform linux/arm/v7 -f ./docker/Dockerfile --build-arg SHAIRPORT_SYNC_BRANCH=charles-dev -t registry.nova.do/shairport-sync:unstable-development . +``` + +`SHAIRPORT_SYNC_BRANCH` is required to ensure the image is built using the expected branch. \ No newline at end of file diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index 4153577a..672639c9 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -8,5 +8,5 @@ services: restart: unless-stopped devices: - "/dev/snd" - volumes: - - ./volumes/shairport-sync/shairport-sync.conf:/etc/shairport-sync.conf \ No newline at end of file + # volumes: + # - ./volumes/shairport-sync/shairport-sync.conf:/etc/shairport-sync.conf # Customised Shairport Sync configuration file. \ No newline at end of file diff --git a/docker/shairport-sync.conf b/docker/shairport-sync.conf deleted file mode 100644 index bb447958..00000000 --- a/docker/shairport-sync.conf +++ /dev/null @@ -1,14 +0,0 @@ -# Temp sample Configuration File for Shairport Sync on a Raspberry Pi using the built-in audio DAC. -general = -{ - volume_range_db = 60; -}; - -alsa = -{ - output_device = "hw:0"; - # Could also be hw:1. aplay -l should help identify the correct one. - # e.g. card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones] - # card x where x is the number to use above in hw:x - mixer_control_name = "Headphone"; -}; \ No newline at end of file