docker-calibre-web/Dockerfile

38 lines
1.0 KiB
Docker
Raw Normal View History

## Buildstage ##
FROM ghcr.io/linuxserver/baseimage-ubuntu:focal as buildstage
2017-03-20 18:34:52 -07:00
ARG BUILD_DATE
ARG VERSION
ARG CALIBRE_RELEASE
2017-03-20 18:34:52 -07:00
LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}"
LABEL maintainer="chbmb"
2017-03-20 18:34:52 -07:00
RUN \
echo "**** Install packages ****" && \
2019-06-04 20:48:24 -07:00
apt-get update && \
apt-get install -y \
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 && \
CALIBRE_RELEASE=$(echo "${CALIBRE_RELEASE}" | sed 's/^v//g' ) && \
2017-03-20 18:34:52 -07:00
mkdir -p \
/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 \
/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
# Add files from buildstage
COPY --from=buildstage /root-layer/ /