Files
nils d6a3ca335a
Set variables for a Docker build (used by another workflow). / Set variables required for docker build. (push) Successful in 1s
Build and conditionally push docker image / docker-vars (push) Successful in 1s
Build and conditionally push docker image / Build and conditionally push docker image (SHAIRPORT_SYNC_BRANCH=. , ./docker/classic/Dockerfile, classic) (push) Failing after 31m49s
Build and conditionally push docker image / Build and conditionally push docker image (SHAIRPORT_SYNC_BRANCH=. NQPTP_BRANCH=${{ needs.docker-vars.outputs.nqptp_branch }} , ./docker/Dockerfile, main) (push) Failing after 31m50s
Add runtime and nqptp image targets to the ohm Dockerfile
The runtime image carries only shairport-sync and its libraries and
expects the node's avahi via the host D-Bus socket; nqptp runs as a
sidecar sharing /dev/shm.
2026-08-29 00:15:32 +02:00

113 lines
3.8 KiB
Docker

# Minimal cross-build of shairport-sync with the OHM Songcast sender backend,
# for linux/arm64 (Raspberry Pi OS aarch64). Produces a glibc binary compatible
# with Debian bullseye (glibc 2.31) and later (e.g. bookworm).
#
# Usage from the repo root:
# docker buildx build --platform linux/arm64 --target binary \
# -f docker/Dockerfile.ohm --output type=local,dest=./out-ohm .
#
# Then copy ./out-ohm/shairport-sync to the Pi.
#
# FFmpeg is taken from Debian packages (libavcodec-dev etc.) rather than built
# from source, to keep the cross-build fast under emulation.
ARG DEBIAN_VERSION=bullseye
FROM --platform=linux/arm64 debian:${DEBIAN_VERSION} AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
autoconf \
automake \
libtool \
pkg-config \
git \
ca-certificates \
xxd \
libasound2-dev \
libplist-dev \
libplist-utils \
libssl-dev \
libsodium-dev \
libgcrypt-dev \
uuid-dev \
libavcodec-dev \
libavformat-dev \
libswresample-dev \
libavutil-dev \
libavahi-client-dev \
avahi-daemon \
libdbus-1-dev \
libglib2.0-dev \
libconfig-dev \
libpopt-dev \
libsndfile-dev \
libsoxr-dev \
xmltoman \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /shairport-sync
COPY . .
WORKDIR /shairport-sync/build
RUN autoreconf -i ../
RUN ../configure --sysconfdir=/etc --with-alsa \
--with-avahi --with-ssl=openssl \
--with-airplay-2 --with-ffmpeg --with-metadata \
--with-ohm --with-dummy --with-pipe --with-stdout \
--with-dbus-interface --with-mpris-interface \
--with-convolution --with-soxr
RUN make -j"$(nproc)"
RUN make install DESTDIR=/install
# Target that yields just the binary on the host filesystem via --output.
FROM --platform=linux/arm64 scratch AS binary
COPY --from=builder /shairport-sync/build/shairport-sync /shairport-sync
# nqptp sidecar image for AirPlay 2 timing; shares /dev/shm with the
# shairport-sync container (see k8s/shairport-ohm.yaml).
FROM --platform=linux/arm64 debian:${DEBIAN_VERSION} AS nqptp-build
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential autoconf automake libtool git ca-certificates \
&& rm -rf /var/lib/apt/lists/*
RUN git clone --depth=1 https://github.com/mikebrady/nqptp /nqptp
WORKDIR /nqptp
RUN autoreconf -i && ./configure && make
FROM --platform=linux/arm64 debian:${DEBIAN_VERSION}-slim AS nqptp
COPY --from=nqptp-build /nqptp/nqptp /usr/local/bin/nqptp
ENTRYPOINT ["/usr/local/bin/nqptp"]
# Deployable runtime image. Uses the node's avahi (host D-Bus socket mounted)
# and the nqptp sidecar (shared /dev/shm); see k8s/shairport-ohm.yaml.
#
# docker buildx build --platform linux/arm64 --target runtime \
# -t <registry>/shairport-sync-ohm:latest -f docker/Dockerfile.ohm --push .
# docker buildx build --platform linux/arm64 --target nqptp \
# -t <registry>/nqptp:latest -f docker/Dockerfile.ohm --push .
FROM --platform=linux/arm64 debian:${DEBIAN_VERSION}-slim AS runtime
ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends \
libasound2 \
libavahi-client3 \
libavcodec58 \
libavformat58 \
libavutil56 \
libconfig9 \
libgcrypt20 \
libglib2.0-0 \
libplist3 \
libpopt0 \
libsndfile1 \
libsodium23 \
libsoxr0 \
libssl1.1 \
libswresample3 \
libuuid1 \
&& rm -rf /var/lib/apt/lists/*
COPY --from=builder /install/usr/local/bin/shairport-sync /usr/local/bin/shairport-sync
ENTRYPOINT ["/usr/local/bin/shairport-sync"]