Make build multi-stage

This commit is contained in:
Joey Hafner 2022-07-12 06:36:08 +00:00
parent bff3d8f6b6
commit d2963dfb36

View File

@ -14,7 +14,9 @@ RUN \
git \ git \
libldap2-dev \ libldap2-dev \
libsasl2-dev \ libsasl2-dev \
python3-pip && \ python3-pip
RUN \
echo "**** install runtime packages ****" && \ echo "**** install runtime packages ****" && \
apt-get install -y \ apt-get install -y \
imagemagick \ imagemagick \
@ -27,29 +29,9 @@ RUN \
libxrandr2 \ libxrandr2 \
python3-minimal \ python3-minimal \
python3-pkg-resources \ python3-pkg-resources \
unrar && \ unrar
echo "**** install calibre-web (a worse way than LSIO's method) ****" && \
# if [ -z ${CALIBREWEB_RELEASE+x} ]; then \ RUN \
# CALIBREWEB_RELEASE=$(curl -sX GET "https://api.github.com/repos/janeczku/calibre-web/releases/latest" \
# | awk '/tag_name/{print $4;exit}' FS='[""]'); \
# fi && \
# curl -o \
# /tmp/calibre-web.tar.gz -L \
# https://github.com/janeczku/calibre-web/archive/${CALIBREWEB_RELEASE}.tar.gz && \
# mkdir -p \
# /app/calibre-web && \
# tar xf \
# /tmp/calibre-web.tar.gz -C \
# /app/calibre-web --strip-components=1 && \
# this is my lazy alternative to lsio's pretty one:
git clone https://gitlab.jafner.net/Jafner/calibre-web.git /app/calibre-web && \
#
cd /app/calibre-web && \
pip3 install --no-cache-dir -U \
pip && \
pip install --no-cache-dir -U --ignore-installed --find-links https://wheel-index.linuxserver.io/ubuntu/ -r \
requirements.txt -r \
optional-requirements.txt && \
echo "**** install kepubify ****" && \ echo "**** install kepubify ****" && \
if [ -z ${KEPUBIFY_RELEASE+x} ]; then \ if [ -z ${KEPUBIFY_RELEASE+x} ]; then \
KEPUBIFY_RELEASE=$(curl -sX GET "https://api.github.com/repos/pgaskin/kepubify/releases/latest" \ KEPUBIFY_RELEASE=$(curl -sX GET "https://api.github.com/repos/pgaskin/kepubify/releases/latest" \
@ -57,7 +39,20 @@ RUN \
fi && \ fi && \
curl -o \ curl -o \
/usr/bin/kepubify -L \ /usr/bin/kepubify -L \
https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-64bit && \ https://github.com/pgaskin/kepubify/releases/download/${KEPUBIFY_RELEASE}/kepubify-linux-64bit
RUN \
echo "**** install calibre-web (a worse way than LSIO's method) ****" && \
# this is my lazy alternative to lsio's pretty one:
git clone https://gitlab.jafner.net/Jafner/calibre-web.git /app/calibre-web && \
cd /app/calibre-web && \
pip3 install --no-cache-dir -U \
pip && \
pip install --no-cache-dir -U --ignore-installed --find-links https://wheel-index.linuxserver.io/ubuntu/ -r \
requirements.txt -r \
optional-requirements.txt
RUN \
echo "**** cleanup ****" && \ echo "**** cleanup ****" && \
apt-get -y purge \ apt-get -y purge \
git \ git \