From bca004f7d1efa23e2ba019798e24303b8e62c43f Mon Sep 17 00:00:00 2001 From: Charles <32498151+charlesomer@users.noreply.github.com> Date: Thu, 20 May 2021 11:49:19 +0100 Subject: [PATCH 1/8] Moved autoreconf. --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 1f9f0ca2..1d5030d9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -65,9 +65,9 @@ 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 RUN git submodule init RUN git submodule update +RUN autoreconf -fi # RUN ./configure \ # --with-alsa \ # --with-dummy \ From 10aac5e5fca7c7ab78529385763bb7e84ccbbac8 Mon Sep 17 00:00:00 2001 From: Charles <32498151+charlesomer@users.noreply.github.com> Date: Thu, 20 May 2021 12:11:59 +0100 Subject: [PATCH 2/8] Test copying SPS directory instead of cloning. --- docker/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 1d5030d9..a15abb8b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -62,9 +62,8 @@ 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" +COPY . . RUN git submodule init RUN git submodule update RUN autoreconf -fi From aa8fcbe7c8cfde484370a180a5a0a50d6e70b6df Mon Sep 17 00:00:00 2001 From: Charles <32498151+charlesomer@users.noreply.github.com> Date: Thu, 20 May 2021 12:22:23 +0100 Subject: [PATCH 3/8] Add information about git branch. --- docker/Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index a15abb8b..723b7f8c 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -64,6 +64,7 @@ WORKDIR / WORKDIR /shairport-sync COPY . . +RUN git status RUN git submodule init RUN git submodule update RUN autoreconf -fi From b0b6500a37e586de381d789e5c91c2a6a5b8c5cf Mon Sep 17 00:00:00 2001 From: Charles <32498151+charlesomer@users.noreply.github.com> Date: Thu, 20 May 2021 12:42:58 +0100 Subject: [PATCH 4/8] Added branch switching for SPS docker build. --- .github/workflows/docker-build.yaml | 8 ++++---- docker/Dockerfile | 8 +++++--- docker/README.md | 11 ++++++++++- 3 files changed, 19 insertions(+), 8 deletions(-) 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 723b7f8c..17ed2451 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 @@ -64,7 +66,7 @@ WORKDIR / WORKDIR /shairport-sync COPY . . -RUN git status +RUN git checkout $SHAIRPORT_SYNC_BRANCH RUN git submodule init RUN git submodule update RUN autoreconf -fi diff --git a/docker/README.md b/docker/README.md index 74b986ca..8172ec08 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=development -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 From 38ad90d410638665b35e1c1656e675e27697af60 Mon Sep 17 00:00:00 2001 From: Charles <32498151+charlesomer@users.noreply.github.com> Date: Thu, 20 May 2021 12:45:38 +0100 Subject: [PATCH 5/8] Never mind, GitHub actions default to trigger branch. --- docker/Dockerfile | 6 ------ docker/README.md | 6 ++---- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 17ed2451..c714462b 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -42,11 +42,6 @@ RUN make install # Shairport Sync Build System: FROM builder-base AS builder-sps -# 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 COPY --from=builder-alac /usr/local/include /usr/local/include @@ -66,7 +61,6 @@ WORKDIR / WORKDIR /shairport-sync COPY . . -RUN git checkout $SHAIRPORT_SYNC_BRANCH RUN git submodule init RUN git submodule update RUN autoreconf -fi diff --git a/docker/README.md b/docker/README.md index 8172ec08..2c221120 100644 --- a/docker/README.md +++ b/docker/README.md @@ -6,7 +6,5 @@ Available at: https://hub.docker.com/r/mikebrady/shairport-sync 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=development -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 +docker buildx build --ssh github=$SSH_AUTH_SOCK --platform linux/arm/v7 -f ./docker/Dockerfile -t registry.nova.do/shairport-sync:unstable-development . +``` \ No newline at end of file From 87ee2aea8e243938fb56e34aa87cc497b7078e16 Mon Sep 17 00:00:00 2001 From: Charles <32498151+charlesomer@users.noreply.github.com> Date: Thu, 20 May 2021 13:10:23 +0100 Subject: [PATCH 6/8] Adding back branch specification just in case. --- docker/Dockerfile | 6 ++++++ docker/README.md | 6 ++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index c714462b..17ed2451 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -42,6 +42,11 @@ RUN make install # Shairport Sync Build System: FROM builder-base AS builder-sps +# 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 COPY --from=builder-alac /usr/local/include /usr/local/include @@ -61,6 +66,7 @@ WORKDIR / WORKDIR /shairport-sync COPY . . +RUN git checkout $SHAIRPORT_SYNC_BRANCH RUN git submodule init RUN git submodule update RUN autoreconf -fi diff --git a/docker/README.md b/docker/README.md index 2c221120..4e10daae 100644 --- a/docker/README.md +++ b/docker/README.md @@ -6,5 +6,7 @@ Available at: https://hub.docker.com/r/mikebrady/shairport-sync 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 -t registry.nova.do/shairport-sync:unstable-development . -``` \ No newline at end of file +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 From a6187fed12acf6316cf1cbb0503da624a2612088 Mon Sep 17 00:00:00 2001 From: Charles <32498151+charlesomer@users.noreply.github.com> Date: Sat, 22 May 2021 12:47:14 +0100 Subject: [PATCH 7/8] Test. --- docker/shairport-sync.conf | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docker/shairport-sync.conf b/docker/shairport-sync.conf index bb447958..49338be1 100644 --- a/docker/shairport-sync.conf +++ b/docker/shairport-sync.conf @@ -1,9 +1,4 @@ # 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"; From 9d9c51d76513cd891cf63781ce2e5a9489bbfbde Mon Sep 17 00:00:00 2001 From: Charles <32498151+charlesomer@users.noreply.github.com> Date: Mon, 24 May 2021 13:55:07 +0100 Subject: [PATCH 8/8] Removed .conf file. --- docker/Dockerfile | 1 - docker/docker-compose.yaml | 4 ++-- docker/shairport-sync.conf | 9 --------- 3 files changed, 2 insertions(+), 12 deletions(-) delete mode 100644 docker/shairport-sync.conf diff --git a/docker/Dockerfile b/docker/Dockerfile index 17ed2451..d7df1481 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -130,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/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 49338be1..00000000 --- a/docker/shairport-sync.conf +++ /dev/null @@ -1,9 +0,0 @@ -# Temp sample Configuration File for Shairport Sync on a Raspberry Pi using the built-in audio DAC. -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