Service Jibri Not Found On Docker File

I have a weird issue going on with Jibri in my Dockerfile where I am getting the error:

service jibri start
jibri: unrecognized service

My docker installation is as such:



ARG UBUNTU_VERSION=18.04
ARG DRIVER_VERSION=21.30
FROM nvidia/cuda:11.5.0-devel-ubuntu18.04
ARG UBUNTU_VERSION
ARG DRIVER_VERSION

ENV DRIVER_VERSION=${DRIVER_VERSION}
ENV UBUNTU_VERSION=${UBUNTU_VERSION}
ENV DEBIAN_FRONTEND=noninteractive 

# Set environment variables
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64:${LD_LIBRARY_PATH}
ENV PATH /usr/local/nvidia/bin:${PATH}

ARG BUILD_DATE
ARG VCS_REF

COPY ./.docker/staging/supervisord.conf /etc/supervisord.conf

# Compile and install fresh ffmpeg from sources:
# See: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu
RUN apt-get update -qq && apt-get -y install \
      autoconf \
      automake \
      apt-utils \
      gcc \
      g++ \
      make \
      build-essential \
      cmake \
      curl \
      git-core \
      libass-dev \
      libssl-dev \
      libfreetype6-dev \
      libsdl2-dev \
      libpq-dev \
      libtool \
      libva-dev \
      libvdpau-dev \
      libvorbis-dev \
      libxcb1-dev \
      libxcb-shm0-dev \
      libxcb-xfixes0-dev \
      pkg-config \
      texinfo \
      wget \
      zlib1g-dev \
      nasm \
      yasm \
      libx265-dev \
      libnuma-dev \
      libvpx-dev \
      libmp3lame-dev \
      libopus-dev \
      libx264-dev \
      libfdk-aac-dev \
      gnupg \
      gnupg2 \
      procps \
      apt-transport-https \ 
      ca-certificates \ 
      curl \ 
      nano \
      software-properties-common \
      supervisor \
      default-jre-headless \
      alsa-utils \
      icewm \
      xdotool \
      xserver-xorg-video-dummy \
      ruby-hocon \
      libx11-dev \
      libxfixes-dev \
      libxcb1-dev \
      libxext-dev \
      libxcb-shm0-dev \
      libxcb-xfixes0-dev \
      openjdk-8-jre-headless \
      uuid-runtime \
      linux-image-extra-virtual

#Install snd_aloop
RUN echo "snd_aloop" >> /etc/modules

#RUN modprobe snd-aloop

#Install Chrome Drive
WORKDIR /tmp

RUN curl https://dl-ssl.google.com/linux/linux_signing_key.pub | sh -c 'gpg --dearmor > /usr/share/keyrings/google-chrome-keyring.gpg'
RUN echo "deb [arch=amd64 signed-by=/usr/share/keyrings/google-chrome-keyring.gpg] http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list
RUN apt-get -y update
RUN apt-get -y install google-chrome-stable

RUN mkdir -p /etc/opt/chrome/policies/managed
RUN echo '{ "CommandLineFlagSecurityWarningsEnabled": false }' >>/etc/opt/chrome/policies/managed/managed_policies.json

RUN CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
RUN wget -N http://chromedriver.storage.googleapis.com/112.0.5615.49/chromedriver_linux64.zip -P ~/
RUN unzip ~/chromedriver_linux64.zip -d ~/
RUN rm ~/chromedriver_linux64.zip
RUN mv -f ~/chromedriver /usr/local/bin/chromedriver
RUN chown root:root /usr/local/bin/chromedriver
RUN chmod 0755 /usr/local/bin/chromedriver

#Jibri Libraries
RUN curl https://download.jitsi.org/jitsi-key.gpg.key | sh -c 'gpg --dearmor > /usr/share/keyrings/jitsi-keyring.gpg'
RUN echo 'deb [signed-by=/usr/share/keyrings/jitsi-keyring.gpg] https://download.jitsi.org stable/' | tee /etc/apt/sources.list.d/jitsi-stable.list > /dev/null


RUN apt-get update && apt-get install -y nvidia-driver-525 \
    nvidia-dkms-525 \
    libnvidia-gl-525 \
    libnvidia-compute-525 \
    libnvidia-decode-525 \
    libnvidia-encode-525 \
    #libnvidia-ifr1-525 \
    libnvidia-fbc1-525 \
    libnvidia-cfg1-525 \
    libnvidia-common-525 \
    libva-drm2 \
    mesa-vdpau-drivers \
    vainfo

# Install ffnvcodec
RUN git clone https://git.videolan.org/git/ffmpeg/nv-codec-headers.git \
    && cd nv-codec-headers \
    && make install \
    && cd .. \
    && rm -rf nv-codec-headers
    



RUN mkdir -p ~/ffmpeg_sources ~/bin && cd ~/ffmpeg_sources && \
    wget -O ffmpeg-5.1.2.tar.bz2  https://ffmpeg.org/releases/ffmpeg-5.1.2.tar.bz2  && \
    tar xjvf ffmpeg-5.1.2.tar.bz2  && \
    cd ffmpeg-5.1.2 && \
    PATH="$HOME/bin:$PATH" PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure \
      --prefix="$HOME/ffmpeg_build" \
      --pkg-config-flags="--static" \
      --extra-cflags="-I$HOME/ffmpeg_build/include" \
      --extra-ldflags="-L$HOME/ffmpeg_build/lib" \
      --extra-libs="-lpthread -lm" \
      --bindir="$HOME/bin" \
      --enable-libfdk-aac \
      --enable-gpl \
      --enable-libass \
      --enable-libfreetype \
      --enable-libmp3lame \
      --enable-libopus \
      --enable-libvorbis \
      --enable-libvpx \
      --enable-libx264 \
      --enable-libx265 \
      --enable-openssl \
      --enable-cuda-nvcc \
      --enable-cuda-sdk \
      --enable-libnpp \
      --enable-libxcb \
      --enable-nvenc \
      --enable-cuda \
      --enable-cuvid \
      --extra-cflags=-I/usr/local/cuda/include \
      --extra-ldflags=-L/usr/local/cuda/lib64 \
      --enable-nonfree && \
    PATH="$HOME/bin:$PATH" make -j8 && \
    make install -j8 && \
    hash -r

RUN mv ~/bin/ffmpeg /usr/bin/ffmpeg && mv ~/bin/ffprobe /usr/local/bin && mv ~/bin/ffplay /usr/local/bin

RUN apt-get update -y

RUN apt-get install jibri -y
RUN apt-get install nginx libnginx-mod-rtmp -y

RUN usermod -aG adm,audio,video,plugdev jibri

RUN mkdir -p /srv
RUN mkdir -p /srv/recordings

# Install Node
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - && \
  apt-get update &&  apt-get install -y nodejs

RUN npm update npm -g

RUN npm install pm2 -g

#Copy Over the file

RUN rm /etc/jitsi/jibri/jibri.conf
COPY ./.docker/staging/etc/jitsi/jibri/jibri.conf /etc/jitsi/jibri/jibri.conf

RUN rm /etc/nginx/nginx.conf
COPY ./.docker/staging/etc/nginx/nginx.conf /etc/nginx/nginx.conf

#COPY ./.docker/staging/etc/systemd/system/jibri.service /etc/systemd/system/jibri.service
COPY ./.docker/staging/etc/systemd/system/update-jibri-config.service /etc/systemd/system/update-jibri-config.service


COPY ./.docker/staging/srv/finalize_recording.sh /srv/finalize_recording.sh 
COPY ./finish-server/server.js /srv/server.js
COPY ./finish-server/recorded.sh /srv/recorded.sh
COPY ./finish-server/package.json /srv/package.json

COPY ./.docker/staging/usr/local/bin/ffmpeg /usr/local/bin/ffmpeg
COPY ./.docker/staging/usr/local/bin/update-jibri-config.sh /usr/local/bin/update-jibri-config.sh

WORKDIR /srv
RUN npm install

EXPOSE 80 443 5222 5347 4443 10000/udp


RUN ["chmod", "+x", "/etc/supervisord.conf"]
RUN ["chmod", "+x", "/usr/bin/ffmpeg"]
RUN ["chmod", "+x", "/usr/local/bin/ffmpeg"]
RUN ["chmod", "+x", "/usr/local/bin/update-jibri-config.sh"]
RUN ["chmod", "+x", "/srv/server.js"]
RUN ["chmod", "+x", "/srv/recorded.sh"]
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]

Now in my /etc/systemd/system/jibri.service, Jibri is installing the following:

[Unit]
Description=Jibri Process
Requires=jibri-icewm.service jibri-xorg.service
After=network.target

[Service]
User=jibri
Group=jibri
PermissionsStartOnly=true
ExecStart=/opt/jitsi/jibri/launch.sh
ExecStop=/opt/jitsi/jibri/graceful_shutdown.sh
ExecReload=/opt/jitsi/jibri/reload.sh
Restart=always
RestartPreventExitStatus=255
Type=simple

[Install]
WantedBy=multi-user.target

Any ideas why the service is not being recognized in a Docker container?

Does your ExecStart script launch the Docker container? Did you enable the service with systemctl xxx enable ?

yes, and I get this inside the docker container:

systemctl enable jibri

Created symlink /etc/systemd/system/multi-user.target.wants/jibri.service → /etc/systemd/system/jibri.service.

root@72df153fa4e5:/srv# service jibri status

jibri: unrecognized service

There is no systemd running inside the container. What is it you want to do?