From 46ae4f64605ae5a80dc1d5e1fadc59b38df8741c Mon Sep 17 00:00:00 2001 From: jb-alvarado Date: Tue, 28 Mar 2023 10:23:20 +0200 Subject: [PATCH] cleanup, optional use local rpm file --- docker/Almalinux.Dockerfile | 49 ++++++++++++++++-------------------- docker/Dockerfile | 14 +++++------ docker/fromSource.Dockerfile | 19 ++++++-------- 3 files changed, 35 insertions(+), 47 deletions(-) diff --git a/docker/Almalinux.Dockerfile b/docker/Almalinux.Dockerfile index b05873e6..e4eb3504 100644 --- a/docker/Almalinux.Dockerfile +++ b/docker/Almalinux.Dockerfile @@ -5,45 +5,38 @@ RUN dnf -y install libgomp && \ dnf clean all; RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ -systemd-tmpfiles-setup.service ] || rm -f $i; done); \ -rm -f /lib/systemd/system/multi-user.target.wants/*;\ -rm -f /etc/systemd/system/*.wants/*;\ -rm -f /lib/systemd/system/local-fs.target.wants/*; \ -rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ -rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ -rm -f /lib/systemd/system/basic.target.wants/*;\ -rm -f /lib/systemd/system/anaconda.target.wants/*; - - + systemd-tmpfiles-setup.service ] || rm -f $i; done); \ + rm -f /lib/systemd/system/multi-user.target.wants/*; \ + rm -f /etc/systemd/system/*.wants/*; \ + rm -f /lib/systemd/system/local-fs.target.wants/*; \ + rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ + rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ + rm -f /lib/systemd/system/basic.target.wants/*; \ + rm -f /lib/systemd/system/anaconda.target.wants/* FROM base ARG FFPLAYOUT_VERSION=0.17.0-beta7 +COPY README.md *.rpm /tmp/ -ENV LD_LIBRARY_PATH=/usr/local/lib64:/usr/local/lib +RUN echo $(ls /tmp/) -ADD ./overide.conf /etc/systemd/system/ffplayout.service.d/overide.conf -ADD ./overide.conf /etc/systemd/system/ffpapi.service.d/overide.conf - - -RUN dnf install -y epel-release && \ +RUN dnf update -y && \ + dnf install -y epel-release && \ dnf install -y 'dnf-command(config-manager)' && \ dnf config-manager --set-enabled crb && \ dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/free/el/rpmfusion-free-release-$(rpm -E %rhel).noarch.rpm && \ dnf install -y --nogpgcheck https://mirrors.rpmfusion.org/nonfree/el/rpmfusion-nonfree-release-$(rpm -E %rhel).noarch.rpm && \ - dnf install -y ffmpeg ffmpeg-devel + dnf install -y ffmpeg ffmpeg-devel wget dejavu-sans-fonts sudo && \ + dnf clean all -RUN \ - dnf update -y \ - && dnf install -y wget dejavu-sans-fonts sudo \ - && wget -q -O /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm "https://github.com/ffplayout/ffplayout/releases/download/v${FFPLAYOUT_VERSION}/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm" \ - && dnf install -y /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm \ - && dnf clean all \ - && rm /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm \ - && mkdir -p /home/ffpu && chown -R ffpu: /home/ffpu \ - && systemctl enable ffplayout \ - && systemctl enable ffpapi \ - && ffpapi -u admin -p admin -m contact@example.com +RUN [[ -f /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm ]] || wget -q "https://github.com/ffplayout/ffplayout/releases/download/v${FFPLAYOUT_VERSION}/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm" -P /tmp/ && \ + dnf install -y /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm && \ + rm /tmp/ffplayout-${FFPLAYOUT_VERSION}-1.x86_64.rpm && \ + mkdir -p /home/ffpu && chown -R ffpu: /home/ffpu && \ + systemctl enable ffplayout && \ + systemctl enable ffpapi && \ + ffpapi -u admin -p admin -m contact@example.com EXPOSE 8787 diff --git a/docker/Dockerfile b/docker/Dockerfile index cde66450..72c5e8c1 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -6,20 +6,18 @@ RUN yum -y install libgomp && \ RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ systemd-tmpfiles-setup.service ] || rm -f $i; done); \ - rm -f /lib/systemd/system/multi-user.target.wants/*;\ - rm -f /etc/systemd/system/*.wants/*;\ + rm -f /lib/systemd/system/multi-user.target.wants/*; \ + rm -f /etc/systemd/system/*.wants/*; \ rm -f /lib/systemd/system/local-fs.target.wants/*; \ rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ - rm -f /lib/systemd/system/basic.target.wants/*;\ - rm -f /lib/systemd/system/anaconda.target.wants/*; - + rm -f /lib/systemd/system/basic.target.wants/*; \ + rm -f /lib/systemd/system/anaconda.target.wants/* FROM base AS build WORKDIR /tmp/workdir - ENV FFMPEG_VERSION=5.1.2 \ AOM_VERSION=v1.0.0 \ LIBASS_VERSION=0.13.7 \ @@ -38,7 +36,6 @@ ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ ARG PREFIX=/opt/ffmpeg ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" - RUN buildDeps="autoconf \ automake \ bzip2 \ @@ -97,7 +94,6 @@ RUN buildDeps="autoconf \ yum history undo $(yum history info | grep 'Transaction ID' | awk -F: '{print$2}' | tr -d ' ') -y && \ yum autoremove -y - RUN yum -y install \ lame-libs \ openjpeg-libs \ @@ -138,6 +134,7 @@ RUN \ make -j $(nproc | awk '{print $1 / 2}') && \ make install && \ rm -rf ${DIR} + ## fontconfig https://www.freedesktop.org/wiki/Software/fontconfig/ RUN \ DIR=/tmp/fontconfig && \ @@ -149,6 +146,7 @@ RUN \ make -j $(nproc | awk '{print $1 / 2}') && \ make install && \ rm -rf ${DIR} + ## libass https://github.com/libass/libass RUN \ DIR=/tmp/libass && \ diff --git a/docker/fromSource.Dockerfile b/docker/fromSource.Dockerfile index a3710d56..a7cc516b 100644 --- a/docker/fromSource.Dockerfile +++ b/docker/fromSource.Dockerfile @@ -5,21 +5,19 @@ RUN yum -y install libgomp && \ yum clean all; RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \ -systemd-tmpfiles-setup.service ] || rm -f $i; done); \ -rm -f /lib/systemd/system/multi-user.target.wants/*;\ -rm -f /etc/systemd/system/*.wants/*;\ -rm -f /lib/systemd/system/local-fs.target.wants/*; \ -rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ -rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ -rm -f /lib/systemd/system/basic.target.wants/*;\ -rm -f /lib/systemd/system/anaconda.target.wants/*; - + systemd-tmpfiles-setup.service ] || rm -f $i; done); \ + rm -f /lib/systemd/system/multi-user.target.wants/*; \ + rm -f /etc/systemd/system/*.wants/*; \ + rm -f /lib/systemd/system/local-fs.target.wants/*; \ + rm -f /lib/systemd/system/sockets.target.wants/*udev*; \ + rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \ + rm -f /lib/systemd/system/basic.target.wants/*; \ + rm -f /lib/systemd/system/anaconda.target.wants/* FROM base AS build WORKDIR /tmp/workdir - ENV FFMPEG_VERSION=5.1.2 \ AOM_VERSION=v1.0.0 \ FDKAAC_VERSION=0.1.5 \ @@ -57,7 +55,6 @@ ARG PKG_CONFIG_PATH="/opt/ffmpeg/share/pkgconfig:/opt/ffmpeg/lib/pkgconfig:/opt/ ARG PREFIX=/opt/ffmpeg ARG LD_LIBRARY_PATH="/opt/ffmpeg/lib:/opt/ffmpeg/lib64" - RUN buildDeps="autoconf \ automake \ bzip2 \