-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Switch from ubuntu:focal to debian:bookworm-slim for smaller image and newer opam. Add ffmpeg and ssl support. Two-stage build to remove build dependencies from final image.
- Loading branch information
Showing
1 changed file
with
57 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,4 @@ | ||
FROM ubuntu:focal | ||
|
||
LABEL maintainer="Kirill Plotnikov <[email protected]>" \ | ||
github="https://github.com/pltnk/docker-liquidsoap" | ||
FROM debian:bookworm-slim AS builder | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
|
@@ -10,11 +7,20 @@ RUN apt update && apt upgrade -y && \ | |
apt install -y \ | ||
opam \ | ||
gcc \ | ||
libavcodec-dev \ | ||
libavdevice-dev \ | ||
libavfilter-dev \ | ||
libavformat-dev \ | ||
libavutil-dev \ | ||
libswresample-dev \ | ||
libswscale-dev \ | ||
libcurl4-gnutls-dev \ | ||
libmad0-dev \ | ||
libmp3lame-dev \ | ||
libogg-dev \ | ||
libpcre3-dev \ | ||
libsamplerate0-dev \ | ||
libssl-dev \ | ||
libtag1-dev \ | ||
libvorbis-dev \ | ||
m4 \ | ||
|
@@ -24,26 +30,59 @@ RUN apt update && apt upgrade -y && \ | |
apt autoremove && apt clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# add user for liquidsoap and create necessary directories | ||
RUN groupadd -g 999 radio && \ | ||
useradd -m -r -u 999 -s /bin/bash -g radio radio && \ | ||
mkdir /etc/liquidsoap /music && \ | ||
chown -R radio /etc/liquidsoap /music | ||
|
||
ARG LIQUIDSOAP_VERSION | ||
ARG OPAM_PACKAGES="liquidsoap${LIQUIDSOAP_VERSION:+.$LIQUIDSOAP_VERSION} taglib mad lame vorbis cry samplerate" | ||
|
||
USER radio | ||
ARG OPAM_PACKAGES="liquidsoap${LIQUIDSOAP_VERSION:+.$LIQUIDSOAP_VERSION} taglib mad lame vorbis cry samplerate ssl ffmpeg" | ||
|
||
# setup opam | ||
RUN opam init -a -y --disable-sandboxing && \ | ||
eval $(opam env) && \ | ||
opam install -y depext | ||
RUN opam init -a -y --disable-sandboxing | ||
|
||
# install liquidsoap | ||
RUN opam depext -y ${OPAM_PACKAGES} && \ | ||
opam install -y ${OPAM_PACKAGES} && \ | ||
RUN opam install -y ${OPAM_PACKAGES} && \ | ||
eval $(opam env) && \ | ||
opam clean -acryv --logs --unused-repositories | ||
|
||
CMD eval $(opam env) && liquidsoap /etc/liquidsoap/script.liq | ||
|
||
|
||
FROM debian:bookworm-slim | ||
|
||
LABEL maintainer="Kirill Plotnikov <[email protected]>" \ | ||
github="https://github.com/pltnk/docker-liquidsoap" | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt update && apt upgrade -y && \ | ||
apt install -y \ | ||
libavcodec59 \ | ||
libavdevice59 \ | ||
libavfilter8 \ | ||
libavformat59 \ | ||
libavutil57 \ | ||
libcurl3-gnutls \ | ||
libmad0 \ | ||
libmp3lame0 \ | ||
libogg0 \ | ||
libpcre3 \ | ||
libsamplerate0 \ | ||
libssl3 \ | ||
libswresample4 \ | ||
libswscale6 \ | ||
libtag1v5-vanilla \ | ||
libvorbis0a \ | ||
libvorbisenc2 \ | ||
libvorbisfile3 \ | ||
&& \ | ||
apt autoremove && apt clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY --from=builder /root/.opam/default/bin/liquidsoap /usr/local/bin | ||
|
||
# add user for liquidsoap and create necessary directories | ||
RUN groupadd -g 999 radio && \ | ||
useradd -m -r -u 999 -s /bin/bash -g radio radio && \ | ||
mkdir /etc/liquidsoap /music && \ | ||
chown -R radio /etc/liquidsoap /music | ||
|
||
USER radio | ||
|
||
CMD liquidsoap /etc/liquidsoap/script.liq |