mdhiggins / sonarr-sma

Sonarr docker based on linuxserver/sonarr with SMA built in using python3
MIT License
38 stars 18 forks source link

Docker on Raspberry Pi #19

Closed dacaz5 closed 3 years ago

dacaz5 commented 3 years ago

Is there a way to get this and the Radarr one running on a Raspberry Pi docker machine?

mdhiggins commented 3 years ago

I don't believe so. The build tag could probably work for Sonarr/Radarr using linuxserver's arm tags but I don't believe there is an FFMPEG tag for ARM using https://hub.docker.com/r/jrottenberg/ffmpeg which is where the custom builds of FFMPEG come from. If you could find a source for a compatible FFMPEG build you could probably modify the dockerfile to get it to work though

mirophan commented 3 years ago

Hi, in case anyone else stumbles on this, I managed to make it work on the Raspberry Pi by changing a few lines and building the sonarr-sma docker container locally. As sugessted by @mdhiggins, the linuxserver base has an arm tag and in fact, simply pulling linuxserver/sonarr should automatically pull the correct ARM arch.

The main docker-compose.yaml looks like this:

version: "3.7"
services:
  sonarr:
      build:
          context: ./sonarr-sma
          dockerfile: Dockerfile  
      restart: always
      container_name: sonarr
      extra_hosts: *pi
      ports:
        - "8989:8989"
      environment:
        - PUID=1000
        - PGID=1000
        - TZ=Europe/London
      volumes:
        - /mnt/media/downloads:/downloads
        - /mnt/media/downloads:/data
        - /mnt/media/tv_shows:/tv
        # config dirs for sonarr and SMA
        - /mnt/media/appdata/sonarr:/config
        - /mnt/media/appdata/sma:/usr/local/sma/config

Then I cloned this repository into the same folder as the docker-compose file, changing the Dockerfile by installing additional packages (to fix issues with building cryptography on the rpi): RUN build-essential libssl-dev libffi-dev python3-dev cargo python3-pip

and changing line 26 in the original Dockerfile to pull an arm version of the ffmpeg build: wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-armhf-static.tar.xz -O /tmp/ffmpeg.tar.xz && \

The new Dockerfile for sonarr-sma looks like this:

FROM linuxserver/sonarr:latest

ENV SMA_PATH /usr/local/sma
ENV SMA_RS Sonarr
ENV SMA_UPDATE false

# get python3 and git, and install python libraries
RUN \
  apt-get update && \
  apt-get install -y \
    git \
    wget \
    wget \
    build-essential \
    libssl-dev \
    libffi-dev \
    python3-dev cargo\
    python3-pip && \

# make directory
  mkdir ${SMA_PATH} && \
# download repo
  git clone https://github.com/mdhiggins/sickbeard_mp4_automator.git ${SMA_PATH} && \
# install pip, venv, and set up a virtual self contained python environment
  python3 -m pip install -U pip && \
  python3 -m pip install --user virtualenv && \
  python3 -m virtualenv ${SMA_PATH}/venv && \
  ${SMA_PATH}/venv/bin/pip install -r ${SMA_PATH}/setup/requirements.txt && \
# ffmpeg
  wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-armhf-static.tar.xz -O /tmp/ffmpeg.tar.xz && \
  tar -xJf /tmp/ffmpeg.tar.xz -C /usr/local/bin --strip-components 1 && \
  chgrp users /usr/local/bin/ffmpeg && \
  chgrp users /usr/local/bin/ffprobe && \
  chmod g+x /usr/local/bin/ffmpeg && \
  chmod g+x /usr/local/bin/ffprobe && \
# cleanup
  apt-get purge --auto-remove -y && \
  apt-get clean && \
  rm -rf \
    /tmp/* \
    /var/lib/apt/lists/* \
    /var/tmp/*

EXPOSE 8989

VOLUME /config
VOLUME /usr/local/sma/config

# update.py sets FFMPEG/FFPROBE paths, updates API key and Sonarr/Radarr settings in autoProcess.ini
COPY extras/ ${SMA_PATH}/
COPY root/ /

This fix also works for Radarr.

mdhiggins commented 3 years ago

I had quite a hard time getting Radarr to work with this due to weird crytography errors on armhf related to Ubuntu Focal but ultimately think I got away with removing that dependency anyway

As of now the latest/preview tags for Sonarr and latest/nightly tags for Radarr have amd64, armhf, and arm64 images included

image