From c8488d5ab309fb45930cb24f12f08d29c27372d5 Mon Sep 17 00:00:00 2001 From: Markus Pesch Date: Thu, 3 Mar 2022 22:30:37 +0100 Subject: [PATCH] fix: install correct pygments package for debian and ubuntu --- Dockerfile.debian | 16 +++++++++++++--- Dockerfile.ubuntu | 15 ++++++++++++--- 2 files changed, 25 insertions(+), 6 deletions(-) diff --git a/Dockerfile.debian b/Dockerfile.debian index 4d886ec..d57f468 100644 --- a/Dockerfile.debian +++ b/Dockerfile.debian @@ -10,6 +10,9 @@ LABEL maintainer="Markus Pesch " # Environment ENV DEBIAN_FRONTEND="noninteractive" +# set shell +SHELL [ "/bin/bash", "-c" ] + # Runs RUN apt-get update RUN apt-get upgrade --yes @@ -22,9 +25,16 @@ RUN apt-get install --yes \ make \ texlive-full -# version specific packages -RUN if [ $(cat /etc/debian_version) != "11.0" ]; then apt-get install --yes python-pygments; fi -RUN if [ $(cat /etc/debian_version) = "11.0" ]; then apt-get install --yes python3-pygments; fi +# install distribution specific versions +RUN case "$(cat /etc/debian_version)" in \ + 11*) \ + apt-get install --yes python3-pygments \ + ;; \ + *) \ + apt-get install --yes python-pygments \ + ;; \ + esac + # remove dpkg lists RUN rm --recursive --force /var/lib/apt/lists/* diff --git a/Dockerfile.ubuntu b/Dockerfile.ubuntu index 6661366..557f84f 100644 --- a/Dockerfile.ubuntu +++ b/Dockerfile.ubuntu @@ -10,6 +10,9 @@ LABEL maintainer="Markus Pesch " # Environment ENV DEBIAN_FRONTEND="noninteractive" +# set shell +SHELL [ "/bin/bash", "-c" ] + # Runs RUN apt-get update RUN apt-get upgrade --yes @@ -23,9 +26,15 @@ RUN apt-get install --yes \ texlive-full \ xindy -# version specific packages -RUN if [ $(cat /etc/debian_version) != "bullseye/sid" ]; then apt-get install --yes python-pygments; fi -RUN if [ $(cat /etc/debian_version) = "bullseye/sid" ]; then apt-get install --yes python3-pygments; fi +# install distribution specific versions +RUN case "$(cat /etc/debian_version)" in \ + bullseye/sid*) \ + apt-get install --yes python3-pygments \ + ;; \ + *) \ + apt-get install --yes python-pygments \ + ;; \ + esac # remove dpkg lists RUN rm --recursive --force /var/lib/apt/lists/*