From 01ee4ef54899b45d94331bc60504f8f051f5edfc Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Sat, 7 Oct 2023 21:05:20 -0400 Subject: [PATCH 1/2] install unrar from lsio repo --- Dockerfile | 17 +++++------------ Dockerfile.aarch64 | 6 +++++- readme-vars.yml | 1 + 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0e6f6eb4..5e110d11 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ # syntax=docker/dockerfile:1 +FROM ghcr.io/linuxserver/unrar:latest as unrar + FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy # set version label @@ -9,7 +11,6 @@ ARG LAZYLIBRARIAN_COMMIT LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="chbmb" -ARG UNRAR_VERSION=6.2.10 RUN \ echo "**** install build packages ****" && \ @@ -26,17 +27,6 @@ RUN \ python3-minimal \ python3-openssl \ zlib1g && \ - echo "**** install unrar from source ****" && \ - mkdir /tmp/unrar && \ - curl -o \ - /tmp/unrar.tar.gz -L \ - "https://www.rarlab.com/rar/unrarsrc-${UNRAR_VERSION}.tar.gz" && \ - tar xf \ - /tmp/unrar.tar.gz -C \ - /tmp/unrar --strip-components=1 && \ - cd /tmp/unrar && \ - make && \ - install -v -m755 unrar /usr/bin && \ echo "**** install app ****" && \ mkdir -p \ /app/lazylibrarian && \ @@ -72,6 +62,9 @@ RUN \ # add local files COPY root/ / +# add unrar +COPY --from=unrar /usr/bin/unrar-ubuntu /usr/bin/unrar + # ports and volumes EXPOSE 5299 VOLUME /config diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 22aa7df5..d837c191 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,5 +1,7 @@ # syntax=docker/dockerfile:1 +FROM ghcr.io/linuxserver/unrar:arm64v8-latest as unrar + FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy # set version label @@ -9,7 +11,6 @@ ARG LAZYLIBRARIAN_COMMIT LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="chbmb" -ARG UNRAR_VERSION=6.2.10 RUN \ echo "**** install build packages ****" && \ @@ -72,6 +73,9 @@ RUN \ # add local files COPY root/ / +# add unrar +COPY --from=unrar /usr/bin/unrar-ubuntu /usr/bin/unrar + # ports and volumes EXPOSE 5299 VOLUME /config diff --git a/readme-vars.yml b/readme-vars.yml index 56a5698b..9618e49e 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -53,6 +53,7 @@ app_setup_block: | The folks over at servarr.com wrote a good [write-up](https://wiki.servarr.com/docker-guide#consistent-and-well-planned-paths) on how to get started with this. # changelog changelogs: + - {date: "07.10.23:", desc: "Install unrar from [linuxserver repo](https://github.com/linuxserver/docker-unrar)."} - {date: "10.08.23:", desc: "Bump unrar to 6.2.10."} - {date: "01.07.23:", desc: "Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)"} - {date: "07.12.22:", desc: "Rebase to Ubuntu Jammy, migrate to s6v3. Use pyproject.toml for deps. Build unrar from source."} From a0736b4bf908ce193db93563384bb31e833cdb0c Mon Sep 17 00:00:00 2001 From: aptalca <541623+aptalca@users.noreply.github.com> Date: Sat, 7 Oct 2023 21:33:15 -0400 Subject: [PATCH 2/2] switch to python venv, add Levenshtein --- Dockerfile | 12 +++++------- Dockerfile.aarch64 | 22 +++++----------------- readme-vars.yml | 2 +- 3 files changed, 11 insertions(+), 25 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5e110d11..0b7418f5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,21 +11,18 @@ ARG LAZYLIBRARIAN_COMMIT LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="chbmb" - RUN \ echo "**** install build packages ****" && \ apt-get update && \ apt-get install -y \ libjpeg-turbo8-dev \ - python3-pip \ zlib1g-dev && \ echo "**** install runtime packages ****" && \ apt-get install -y \ ghostscript \ libjpeg-turbo8 \ libmagic1 \ - python3-minimal \ - python3-openssl \ + python3-venv \ zlib1g && \ echo "**** install app ****" && \ mkdir -p \ @@ -43,14 +40,15 @@ RUN \ /tmp/lazylibrarian.tar.gz -C \ /app/lazylibrarian --strip-components=1 && \ cd /app/lazylibrarian && \ - pip3 install -U --no-cache-dir \ + python3 -m venv /lsiopy && \ + pip install -U --no-cache-dir \ pip \ wheel && \ - pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ . && \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ . && \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ Levenshtein && \ echo "**** cleanup ****" && \ apt-get -y purge \ libjpeg-turbo8-dev \ - python3-pip \ zlib1g-dev && \ apt-get -y autoremove && \ rm -rf \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index d837c191..bd56e5e7 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -11,33 +11,19 @@ ARG LAZYLIBRARIAN_COMMIT LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" LABEL maintainer="chbmb" - RUN \ echo "**** install build packages ****" && \ apt-get update && \ apt-get install -y \ libjpeg-turbo8-dev \ - python3-pip \ zlib1g-dev && \ echo "**** install runtime packages ****" && \ apt-get install -y \ ghostscript \ libjpeg-turbo8 \ libmagic1 \ - python3-minimal \ - python3-openssl \ + python3-venv \ zlib1g && \ - echo "**** install unrar from source ****" && \ - mkdir /tmp/unrar && \ - curl -o \ - /tmp/unrar.tar.gz -L \ - "https://www.rarlab.com/rar/unrarsrc-${UNRAR_VERSION}.tar.gz" && \ - tar xf \ - /tmp/unrar.tar.gz -C \ - /tmp/unrar --strip-components=1 && \ - cd /tmp/unrar && \ - make && \ - install -v -m755 unrar /usr/bin && \ echo "**** install app ****" && \ mkdir -p \ /app/lazylibrarian && \ @@ -54,10 +40,12 @@ RUN \ /tmp/lazylibrarian.tar.gz -C \ /app/lazylibrarian --strip-components=1 && \ cd /app/lazylibrarian && \ - pip3 install -U --no-cache-dir \ + python3 -m venv /lsiopy && \ + pip install -U --no-cache-dir \ pip \ wheel && \ - pip3 install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ . && \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ . && \ + pip install -U --no-cache-dir --find-links https://wheel-index.linuxserver.io/ubuntu/ Levenshtein && \ echo "**** cleanup ****" && \ apt-get -y purge \ libjpeg-turbo8-dev \ diff --git a/readme-vars.yml b/readme-vars.yml index 9618e49e..6955aae3 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -53,7 +53,7 @@ app_setup_block: | The folks over at servarr.com wrote a good [write-up](https://wiki.servarr.com/docker-guide#consistent-and-well-planned-paths) on how to get started with this. # changelog changelogs: - - {date: "07.10.23:", desc: "Install unrar from [linuxserver repo](https://github.com/linuxserver/docker-unrar)."} + - {date: "07.10.23:", desc: "Install unrar from [linuxserver repo](https://github.com/linuxserver/docker-unrar). Switch to Python virtual environment. Add Levenshtein."} - {date: "10.08.23:", desc: "Bump unrar to 6.2.10."} - {date: "01.07.23:", desc: "Deprecate armhf. As announced [here](https://www.linuxserver.io/blog/a-farewell-to-arm-hf)"} - {date: "07.12.22:", desc: "Rebase to Ubuntu Jammy, migrate to s6v3. Use pyproject.toml for deps. Build unrar from source."}