2019-06-13 08:42:27 -07:00
|
|
|
## Buildstage ##
|
2020-11-01 22:18:43 -08:00
|
|
|
FROM ghcr.io/linuxserver/baseimage-ubuntu:bionic as buildstage
|
2017-03-20 18:34:52 -07:00
|
|
|
|
|
|
|
ARG BUILD_DATE
|
|
|
|
ARG VERSION
|
2019-06-13 08:42:27 -07:00
|
|
|
ARG CALIBRE_RELEASE
|
2017-03-20 18:34:52 -07:00
|
|
|
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
|
2017-12-06 11:12:27 -08:00
|
|
|
LABEL maintainer="chbmb"
|
|
|
|
|
2017-03-20 18:34:52 -07:00
|
|
|
RUN \
|
2019-06-13 08:42:27 -07:00
|
|
|
echo "**** Install packages ****" && \
|
2019-06-04 20:48:24 -07:00
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y \
|
2019-06-13 08:42:27 -07:00
|
|
|
xz-utils && \
|
|
|
|
echo "**** Fetch calibre bin ****" && \
|
|
|
|
if [ -z ${CALIBRE_RELEASE+x} ]; then \
|
|
|
|
CALIBRE_RELEASE=$(curl -sX GET "https://api.github.com/repos/kovidgoyal/calibre/releases/latest" \
|
2019-06-04 20:48:24 -07:00
|
|
|
| awk '/tag_name/{print $4;exit}' FS='[""]'); \
|
|
|
|
fi && \
|
2019-06-13 08:42:27 -07:00
|
|
|
CALIBRE_RELEASE=$(echo "${CALIBRE_RELEASE}" | sed 's/^v//g' ) && \
|
2017-03-20 18:34:52 -07:00
|
|
|
mkdir -p \
|
2019-06-13 08:42:27 -07:00
|
|
|
/root-layer/app/calibre && \
|
|
|
|
curl -o \
|
|
|
|
/tmp/calibre.txz -L \
|
2019-07-11 21:11:03 -07:00
|
|
|
"https://download.calibre-ebook.com/${CALIBRE_RELEASE}/calibre-${CALIBRE_RELEASE}-x86_64.txz" && \
|
2017-03-20 18:34:52 -07:00
|
|
|
tar xf \
|
2019-06-13 08:42:27 -07:00
|
|
|
/tmp/calibre.txz \
|
|
|
|
-C /root-layer/app/calibre
|
|
|
|
|
|
|
|
# copy local files
|
|
|
|
COPY root/ /root-layer/
|
|
|
|
|
|
|
|
## Single layer deployed image ##
|
|
|
|
FROM scratch
|
2017-03-20 18:34:52 -07:00
|
|
|
|
2019-06-13 08:42:27 -07:00
|
|
|
# Add files from buildstage
|
|
|
|
COPY --from=buildstage /root-layer/ /
|