Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install unrar from lsio repo, use venv, add Levenshtein #71

Merged
merged 2 commits into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,34 +11,19 @@ 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 ****" && \
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 && \
Expand All @@ -53,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 \
Expand All @@ -72,6 +60,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
28 changes: 10 additions & 18 deletions Dockerfile.aarch64
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,34 +11,19 @@ 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 ****" && \
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 && \
Expand All @@ -53,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 \
Expand All @@ -72,6 +61,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
1 change: 1 addition & 0 deletions readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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). 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."}
Expand Down