-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
52 lines (44 loc) · 1.73 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
FROM node:18.20
# Build-time metadata as defined at http://label-schema.org
ARG BUILD_DATE
ARG VCS_REF
ARG VCS_URL
ARG IMAGE_VERSION
LABEL maintainer="[email protected]"
LABEL org.label-schema.build-date=$BUILD_DATE
LABEL org.label-schema.name="b-ber"
LABEL org.label-schema.description="A Docker image for creating b-ber projects"
LABEL org.label-schema.url="https://www.canopycanopycanopy.com/"
LABEL org.label-schema.vcs-ref=$VCS_REF
LABEL org.label-schema.vcs-url=$VCS_URL
LABEL org.label-schema.license="MIT"
LABEL org.label-schema.vendor="Triple Canopy"
LABEL org.label-schema.version=$IMAGE_VERSION
LABEL org.label-schema.schema-version="1.0"
# Download URL and source path for calibre
ENV CALIBRE_SOURCE_URL https://raw.githubusercontent.com/kovidgoyal/calibre/master/setup/linux-installer.py
ENV CALIBRE_INSTALL_SCRIPT="import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main(install_dir='/opt', isolated=True, version='5.44.0')"
ENV PATH $PATH:/opt/calibre
# ebook-convert options for Qt to allow running as root
ENV QTWEBENGINE_CHROMIUM_FLAGS "--no-sandbox"
# Calibre requires this to be set with 7700 when building PDFs
ENV XDG_RUNTIME_DIR "/home/xdg-runtime"
# Install deps
RUN apt-get update && apt-get install -y \
wget \
python-is-python3 \
2to3 \
xz-utils \
xdg-utils \
zip \
default-jre
# Get and install AWS CLI
RUN wget "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -O "awscliv2.zip" \
&& unzip awscliv2.zip \
&& aws/install \
&& rm awscliv2.zip
# Get and install calibre
RUN wget -O- "${CALIBRE_SOURCE_URL}" | python -c "${CALIBRE_INSTALL_SCRIPT}" \
&& rm -rf /tmp/calibre-installer-cache \
&& mkdir "${XDG_RUNTIME_DIR}" \
&& chmod 7700 "${XDG_RUNTIME_DIR}"