From b9e495e228917e13eeeab871c682308a4ec997b5 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 17 Jun 2021 21:18:25 -0400 Subject: [PATCH] Docker: Combine `abiword` and `libreoffice` install steps This avoids multiple `apt update` runs if both are to be installed, and it will make it easier to add more packages in the future. --- Dockerfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2a4a99868..27681e702 100644 --- a/Dockerfile +++ b/Dockerfile @@ -55,12 +55,17 @@ RUN groupadd --system ${EP_GID:+--gid "${EP_GID}" --non-unique} etherpad && \ ARG EP_DIR=/opt/etherpad-lite RUN mkdir -p "${EP_DIR}" && chown etherpad:etherpad "${EP_DIR}" -# install abiword for DOC/PDF/ODT export -RUN [ -z "${INSTALL_ABIWORD}" ] || (apt update && apt -y install abiword && apt clean && rm -rf /var/lib/apt/lists/*) - -# install libreoffice for DOC/PDF/ODT export -# the mkdir is needed for configuration of openjdk-11-jre-headless, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863199 -RUN [ -z "${INSTALL_SOFFICE}" ] || (apt update && mkdir -p /usr/share/man/man1 && apt -y install libreoffice && apt clean && rm -rf /var/lib/apt/lists/*) +# the mkdir is needed for configuration of openjdk-11-jre-headless, see +# https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863199 +RUN [ -n "${INSTALL_ABIWORD}${INSTALL_SOFFICE}" ] || exit 0; \ + mkdir -p /usr/share/man/man1 && \ + apt update && \ + apt -y install \ + ${INSTALL_ABIWORD:+abiword} \ + ${INSTALL_SOFFICE:+libreoffice} \ + && \ + apt clean && \ + rm -rf /var/lib/apt/lists/* USER etherpad