mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-11 09:52:14 +01:00
fix: use google chrome stable on amd64 (#333)
This commit is contained in:
@@ -50,6 +50,11 @@ ARG GOTENBERG_USER_GID
|
||||
ARG GOTENBERG_USER_UID
|
||||
ARG PDFTK_VERSION
|
||||
|
||||
# Script for installing either Google Chrome stable on amd64 architecture or
|
||||
# Chromium on arch64 architecture.
|
||||
# See https://github.com/gotenberg/gotenberg/issues/328.
|
||||
COPY build/install-chromium.sh /tmp/install-chromium.sh
|
||||
|
||||
RUN \
|
||||
# Create a non-root user.
|
||||
# All processes in the Docker container will run with this dedicated user.
|
||||
@@ -103,15 +108,17 @@ RUN \
|
||||
fonts-sil-gentium \
|
||||
fonts-sil-gentium-basic &&\
|
||||
rm -f ./ttf-mscorefonts-installer_3.8_all.deb &&\
|
||||
# Install Chromium and LibreOffice.
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends chromium libreoffice &&\
|
||||
# Install Google Chrome / Chromium.
|
||||
/tmp/install-chromium.sh &&\
|
||||
# Install LibreOffice.
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends libreoffice &&\
|
||||
# Download unoconv (Python script).
|
||||
curl -Ls https://raw.githubusercontent.com/dagwieers/unoconv/master/unoconv -o /usr/bin/unoconv &&\
|
||||
chmod +x /usr/bin/unoconv &&\
|
||||
# unoconv will look for the Python binary, which has to be at version 3.
|
||||
ln -s /usr/bin/python3 /usr/bin/python &&\
|
||||
# Download PDFtk.
|
||||
# Credits: https://github.com/thecodingmachine/gotenberg/pull/273.
|
||||
# Credits: https://github.com/gotenberg/gotenberg/pull/273.
|
||||
curl -o /usr/bin/pdftk-all.jar "https://gitlab.com/pdftk-java/pdftk/-/jobs/$PDFTK_VERSION/artifacts/raw/build/libs/pdftk-all.jar" &&\
|
||||
chmod a+x /usr/bin/pdftk-all.jar &&\
|
||||
# See https://github.com/nextcloud/docker/issues/380.
|
||||
|
||||
15
build/install-chromium.sh
Executable file
15
build/install-chromium.sh
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
ARCH=$(dpkg --print-architecture)
|
||||
|
||||
if [[ "$ARCH" == "amd64" ]]; then
|
||||
curl https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
|
||||
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | tee /etc/apt/sources.list.d/google-chrome.list
|
||||
apt-get update -qq
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends --allow-unauthenticated google-chrome-stable
|
||||
mv /usr/bin/google-chrome-stable /usr/bin/chromium
|
||||
else
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends chromium
|
||||
fi
|
||||
Reference in New Issue
Block a user