2022-03-25 22:25:00 +00:00
|
|
|
FROM python:3.9-slim
|
2022-03-25 21:21:17 +00:00
|
|
|
|
|
|
|
# set version label
|
|
|
|
ARG VERSION
|
|
|
|
ARG CALIBRE_RELEASE
|
|
|
|
ARG FFF_RELEASE
|
2022-03-25 21:57:33 +00:00
|
|
|
LABEL build_version="FFDL-Auto version:- ${VERSION} Calibre: ${CALIBRE_RELEASE} FFF: ${FFF_RELEASE}"
|
|
|
|
|
2022-03-25 22:28:37 +00:00
|
|
|
ENV PUID="911" \
|
2022-03-25 22:04:36 +00:00
|
|
|
PGID="911"
|
2022-03-25 21:21:17 +00:00
|
|
|
|
2022-03-25 22:28:37 +00:00
|
|
|
RUN set -x && \
|
2022-03-25 22:30:38 +00:00
|
|
|
apt update && \
|
|
|
|
apt install --no-cache --upgrade \
|
2022-03-25 21:21:17 +00:00
|
|
|
bash \
|
|
|
|
ca-certificates \
|
|
|
|
gcc \
|
|
|
|
mesa-gl \
|
|
|
|
qt5-qtbase-x11 \
|
|
|
|
wget \
|
|
|
|
xdg-utils \
|
|
|
|
xz \
|
|
|
|
curl \
|
|
|
|
dbus \
|
|
|
|
jq \
|
|
|
|
python3
|
2022-03-25 22:18:04 +00:00
|
|
|
|
|
|
|
RUN set -x && \
|
|
|
|
addgroup --gid "$PGID" abc && \
|
|
|
|
adduser \
|
|
|
|
--gecos "" \
|
|
|
|
--disabled-password \
|
|
|
|
--no-create-home \
|
|
|
|
--uid "$PUID" \
|
|
|
|
--ingroup abc \
|
|
|
|
--shell /bin/bash \
|
|
|
|
abc
|
|
|
|
|
2022-03-25 21:21:17 +00:00
|
|
|
RUN echo "**** install calibre ****" && \
|
2022-03-25 22:28:37 +00:00
|
|
|
set -x && \
|
2022-03-25 22:18:04 +00:00
|
|
|
mkdir -p \
|
|
|
|
/opt/calibre && \
|
|
|
|
if [ -z ${CALIBRE_RELEASE+x} ]; then \
|
|
|
|
CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/kovidgoyal/calibre/releases/latest" \
|
|
|
|
| jq -r .tag_name); \
|
|
|
|
fi && \
|
|
|
|
CALIBRE_VERSION="$(echo ${CALIBRE_RELEASE} | cut -c2-)" && \
|
|
|
|
CALIBRE_URL="https://download.calibre-ebook.com/${CALIBRE_VERSION}/calibre-${CALIBRE_VERSION}-x86_64.txz" && \
|
|
|
|
curl -o \
|
|
|
|
/tmp/calibre-tarball.txz -L \
|
|
|
|
"$CALIBRE_URL" && \
|
|
|
|
tar xvf /tmp/calibre-tarball.txz -C \
|
|
|
|
/opt/calibre && \
|
2022-03-25 22:25:00 +00:00
|
|
|
/opt/calibre/calibre_postinstall && \
|
2022-03-25 22:18:04 +00:00
|
|
|
dbus-uuidgen > /etc/machine-id
|
2022-03-25 21:21:17 +00:00
|
|
|
|
|
|
|
RUN echo "**** cleanup ****" && \
|
2022-03-25 22:30:38 +00:00
|
|
|
apt clean && \
|
2022-03-25 21:21:17 +00:00
|
|
|
rm -rf \
|
|
|
|
/tmp/* \
|
|
|
|
/var/lib/apt/lists/* \
|
|
|
|
/var/tmp/*
|
|
|
|
|
|
|
|
RUN echo *** Install Packages *** && \
|
2022-03-25 22:28:37 +00:00
|
|
|
set -x && \
|
2022-03-25 22:30:38 +00:00
|
|
|
apt install --no-cache --upgrade py-pillow && \
|
2022-03-25 21:21:17 +00:00
|
|
|
if [ -z ${FFF_RELEASE+x} ]; then \
|
|
|
|
python3 -m pip --no-cache-dir install FanFicFare \
|
|
|
|
else \
|
|
|
|
python3 -m pip --no-cache-dir install --extra-index-url https://testpypi.python.org/pypi FanFicFare==${FFF_RELEASE} \
|
|
|
|
fi && \
|
|
|
|
python3 -m pip --no-cache-dir install pushbullet.py && \
|
|
|
|
ln -s /opt/calibre/calibredb /bin/calibredb
|
|
|
|
|
|
|
|
COPY root/ /
|
|
|
|
|
|
|
|
VOLUME /config
|
|
|
|
|
|
|
|
WORKDIR /config
|
|
|
|
|
|
|
|
ENTRYPOINT ["/init"]
|