From 111e247b657923a04ce2374dba2fd95841072329 Mon Sep 17 00:00:00 2001 From: Mike Brady <4265913+mikebrady@users.noreply.github.com> Date: Sat, 8 Jun 2024 14:05:26 +0100 Subject: [PATCH] Limit maximum open file handles in Docker images. Increase the level of optimisation while building the Shairport Sync image. --- docker/Dockerfile | 2 +- docker/classic/Dockerfile | 2 +- docker/classic/etc/s6-overlay/s6-rc.d/01-startup/script.sh | 3 +++ docker/etc/s6-overlay/s6-rc.d/01-startup/script.sh | 3 +++ 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index c6da2efd..e47dc5d7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -55,7 +55,7 @@ COPY . . RUN git checkout "$SHAIRPORT_SYNC_BRANCH" WORKDIR /shairport-sync/build RUN autoreconf -i ../ -RUN ../configure --sysconfdir=/etc --with-alsa --with-pa --with-soxr --with-avahi --with-ssl=openssl \ +RUN CFLAGS="-O3" CXXFLAGS="-O3" ../configure --sysconfdir=/etc --with-alsa --with-pa --with-soxr --with-avahi --with-ssl=openssl \ --with-airplay-2 --with-metadata --with-dummy --with-pipe --with-dbus-interface \ --with-stdout --with-mpris-interface --with-mqtt-client \ --with-apple-alac --with-convolution diff --git a/docker/classic/Dockerfile b/docker/classic/Dockerfile index d5978410..d41cac4f 100644 --- a/docker/classic/Dockerfile +++ b/docker/classic/Dockerfile @@ -40,7 +40,7 @@ COPY . . RUN git checkout "$SHAIRPORT_SYNC_BRANCH" WORKDIR /shairport-sync/build RUN autoreconf -i ../ -RUN ../configure --sysconfdir=/etc --with-alsa --with-pa --with-soxr --with-avahi --with-ssl=mbedtls \ +RUN CFLAGS="-O3" CXXFLAGS="-O3" ../configure --sysconfdir=/etc --with-alsa --with-pa --with-soxr --with-avahi --with-ssl=mbedtls \ --with-metadata --with-dummy --with-pipe --with-dbus-interface \ --with-stdout --with-mpris-interface --with-mqtt-client \ --with-apple-alac --with-convolution diff --git a/docker/classic/etc/s6-overlay/s6-rc.d/01-startup/script.sh b/docker/classic/etc/s6-overlay/s6-rc.d/01-startup/script.sh index 3037e98a..253c0afa 100644 --- a/docker/classic/etc/s6-overlay/s6-rc.d/01-startup/script.sh +++ b/docker/classic/etc/s6-overlay/s6-rc.d/01-startup/script.sh @@ -1,2 +1,5 @@ #!/bin/sh echo "STARTING - $(date)" + +# Set the limit to the same value Docker has been using in earlier version. +ulimit -n 1048576 diff --git a/docker/etc/s6-overlay/s6-rc.d/01-startup/script.sh b/docker/etc/s6-overlay/s6-rc.d/01-startup/script.sh index 3037e98a..253c0afa 100644 --- a/docker/etc/s6-overlay/s6-rc.d/01-startup/script.sh +++ b/docker/etc/s6-overlay/s6-rc.d/01-startup/script.sh @@ -1,2 +1,5 @@ #!/bin/sh echo "STARTING - $(date)" + +# Set the limit to the same value Docker has been using in earlier version. +ulimit -n 1048576 -- 2.47.2